Skip to content
Snippets Groups Projects
Commit fee53b5e authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

upgrade-reference: update the benchrepo file with `partial-sets`

The script can now be used to update the partial-sets information in the
`.benchrepo` of the reference. This will prove useful as we introduce more
partial variant (current target, the discovery test).

note: the script is adding the data at the root level, so not the level the code
currently expect. See next changeset for a fix.
parent 9b569d2f
No related branches found
No related tags found
No related merge requests found
......@@ -99,6 +99,13 @@
# drop legacy "repo-hash" attribute
new_benchrepo["reference-repo"].pop("repo-hash", None)
partial_config = read_yaml(partial_sets_config_path)
# note: ideally the partial_sets argument of this script would be optional.
# If present, it would update the partial_sets used by the reference. If
# missing, it would simply reuse the information present in the reference.
partial_sets = partial_config["partial-sets"]
new_benchrepo["partial-sets"] = partial_sets
# And write it
with open(benchrepo_path, "w") as new_benchrepo_file:
new_benchrepo_file.write(
......@@ -121,8 +128,6 @@
# Now check if we have partials archives with the old prefix in the same
# directory as the reference archive
partial_config = read_yaml(partial_sets_config_path)
partial_sets = partial_config["partial-sets"]
rename_partials(
partial_sets,
......@@ -132,6 +137,11 @@
tmp_directory,
)
# XXX We maybe should also check if all the declared partial exist and create
# them otherwize.
#
# At least, we should warn if they are missing.
def rename_partials(
partial_sets,
......
......@@ -98,6 +98,10 @@
$ tar -xf some-dir/my-source-repo-*-reference.tar --wildcards "my-source-repo-*.benchrepo"
$ cat my-source-repo-*.benchrepo
partial-sets:
missing-last-10:
remove: last(all(), 10)
same: null
reference-repo:
format-info:
compression: zlib
......@@ -224,6 +228,10 @@
Directory name inside my-source-repo-1a2b3c4d-partial-same.tar is correct
Removing the temporary directory.
$ tar xf my-source-repo-1a2b3c4d-reference.tar --to-stdout $benchrepofile
partial-sets:
missing-last-10:
remove: last(all(), 10)
same: null
reference-repo:
format-info:
compression: zlib
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment