Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tavern_time_request
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dariusz Kędzierski
tavern_time_request
Commits
9503e08a
Commit
9503e08a
authored
4 years ago
by
Dariusz Kędzierski
Browse files
Options
Downloads
Patches
Plain Diff
Save request data in proxy file
parent
5878fbd4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tavern_time_request/request.py
+3
-2
3 additions, 2 deletions
tavern_time_request/request.py
with
3 additions
and
2 deletions
tavern_time_request/request.py
+
3
−
2
View file @
9503e08a
...
...
@@ -6,6 +6,7 @@ from tavern.util import exceptions
from
tavern._plugins.rest.request
import
RestRequest
from
time
import
perf_counter
as
perf
from
uuid
import
uuid4
from
json
import
dumps
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -16,10 +17,10 @@ class HivemindRequest(RestRequest):
test_id
=
uuid4
()
file_name
=
os
.
getenv
(
"
HIVEMIND_BENCHMARKS_IDS_FILE
"
,
None
)
if
file_name
is
not
None
:
self
.
_request_args
[
'
json
'
][
'
id
'
]
=
str
(
test_id
)
with
open
(
file_name
,
"
a
"
)
as
f
:
writer
=
csv
.
writer
(
f
)
writer
.
writerow
([
str
(
test_id
),
start_time
])
self
.
_request_args
[
'
json
'
][
'
id
'
]
=
str
(
test_id
)
writer
.
writerow
([
str
(
test_id
),
start_time
,
dumps
(
self
.
_request_args
[
'
json
'
])])
return
self
.
_prepared
()
except
requests
.
exceptions
.
RequestException
as
e
:
logger
.
exception
(
"
Error running prepared request
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment