Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
test-tools
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
hive
test-tools
Commits
62d86e2e
Commit
62d86e2e
authored
1 year ago
by
Andrzej Such
Browse files
Options
Downloads
Patches
Plain Diff
Update commands for block_log_util
parent
c4d1eea6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!196
test-tool changes for block_log_util
Pipeline
#90462
passed
11 months ago
Stage: static_code_analysis
Stage: tests
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/test_tools/__private/block_log.py
+7
-3
7 additions, 3 deletions
package/test_tools/__private/block_log.py
with
7 additions
and
3 deletions
package/test_tools/__private/block_log.py
+
7
−
3
View file @
62d86e2e
...
...
@@ -114,7 +114,8 @@ class BlockLog:
def
generate_artifacts
(
self
)
->
None
:
"""
Generate block_log.artifacts file.
"""
self
.
__run_and_get_output
(
"
generate-artifacts
"
,
str
(
self
.
path
))
block_log_arg
=
[
"
--block-log
"
,
str
(
self
.
path
)]
self
.
__run_and_get_output
(
"
--generate-artifacts
"
,
*
block_log_arg
)
def
get_head_block_number
(
self
)
->
int
:
"""
...
...
@@ -124,7 +125,8 @@ class BlockLog:
"""
if
not
self
.
artifacts_path
.
exists
():
self
.
generate_artifacts
()
return
int
(
self
.
__run_and_get_output
(
"
get-head-block-number
"
,
str
(
self
.
path
)))
block_log_arg
=
[
"
--block-log
"
,
str
(
self
.
path
)]
return
int
(
self
.
__run_and_get_output
(
"
--get-head-block-number
"
,
*
block_log_arg
))
def
get_block
(
self
,
block_number
:
int
)
->
BlockLogUtilResult
:
"""
...
...
@@ -136,7 +138,9 @@ class BlockLog:
"""
if
not
self
.
artifacts_path
.
exists
():
self
.
generate_artifacts
()
output
=
self
.
__run_and_get_output
(
"
get-block
"
,
str
(
self
.
path
),
f
"
{
block_number
}
"
).
replace
(
"'"
,
'"'
)
block_log_arg
=
[
"
--block-log
"
,
str
(
self
.
path
)]
block_number_arg
=
[
"
--block-number
"
,
f
"
{
block_number
}
"
]
output
=
self
.
__run_and_get_output
(
"
--get-block
"
,
*
block_log_arg
,
*
block_number_arg
).
replace
(
"'"
,
'"'
)
return
BlockLogUtilResult
(
**
json
.
loads
(
output
))
@overload
...
...
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