Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
ska-logging
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LOFAR2.0
ska-logging
Commits
ac7a5a3f
Unverified
Commit
ac7a5a3f
authored
4 years ago
by
samueltwum1
Browse files
Options
Downloads
Patches
Plain Diff
SAR-149
update pipfile to include skuid
parent
c18d3061
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Pipfile
+1
-0
1 addition, 0 deletions
Pipfile
src/ska/logging/transactions.py
+3
-2
3 additions, 2 deletions
src/ska/logging/transactions.py
tests/test_transactions.py
+1
-1
1 addition, 1 deletion
tests/test_transactions.py
with
5 additions
and
3 deletions
Pipfile
+
1
−
0
View file @
ac7a5a3f
...
...
@@ -25,6 +25,7 @@ sphinx_rtd_theme = "*"
sphinx-autobuild
=
"*"
sphinxcontrib-websupport
=
"*"
recommonmark
=
"*"
skuid
=
{
editable
=
true
,
ref
=
"SAR-147_add_txn_id_endpoint"
,
git
=
"https://gitlab.com/ska-telescope/skuid.git"
}
[dev-packages]
...
...
This diff is collapsed.
Click to expand it.
src/ska/logging/transactions.py
+
3
−
2
View file @
ac7a5a3f
...
...
@@ -7,7 +7,7 @@ import os
from
typing
import
Mapping
,
Text
from
skuid.client
import
SkuidClient
,
get_local_transaction_id
from
ska.
skuid.client
import
SkuidClient
,
get_local_transaction_id
class
transaction
:
"""
Transaction context handler.
...
...
@@ -48,7 +48,8 @@ class transaction:
def
__exit__
(
self
,
exc_type
,
exc_val
,
exc_tb
):
# TODO: more to be done with func arguments
transaction_id
=
self
.
_get_new_or_existing_transaction_id
()
params_json
=
json
.
dumps
(
self
.
_params
)
self
.
logger
.
info
(
f
"
Exit transaction
{
self
.
_name
}
,
{
transaction_id
}
,
{
params_json
}
"
)
def
_get_new_or_existing_transaction_id
(
self
):
...
...
This diff is collapsed.
Click to expand it.
tests/test_transactions.py
+
1
−
1
View file @
ac7a5a3f
...
...
@@ -95,7 +95,7 @@ class TestTransactionIdGenerator:
def
test_remote_id_generator_increments_on_next
(
self
,
monkeypatch
):
monkeypatch
.
setenv
(
"
SKUID_URL
"
,
"
endpoint/to/skuid-client
"
)
with
patch
(
"
skuid.client.requests.get
"
)
as
mocked_req
:
with
patch
(
"
ska.
skuid.client.requests.get
"
)
as
mocked_req
:
response
=
MagicMock
()
response
.
json
.
side_effect
=
[
json
.
dumps
({
"
transaction_id
"
:
1
}),
...
...
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