diff --git a/changelog-entries/811.md b/changelog-entries/811.md deleted file mode 100644 index 8a8bfc6ae..000000000 --- a/changelog-entries/811.md +++ /dev/null @@ -1 +0,0 @@ -- Store each `reference-results-metadata.txt` inside the case directory of its reference results archive instead of sharing one metadata file between all archives of a tutorial. The SHA256 checksum of the outer archive is no longer included, because the metadata now lives inside that archive [#882](https://github.com/precice/tutorials/pull/882). diff --git a/changelog-entries/882.md b/changelog-entries/882.md new file mode 100644 index 000000000..cf64c817f --- /dev/null +++ b/changelog-entries/882.md @@ -0,0 +1 @@ +- Store each `reference-results-metadata.md` inside the case directory of its reference results archive instead of sharing one metadata file between all archives of a tutorial. The SHA256 checksum of the outer archive is no longer included, because the metadata now lives inside that archive [#882](https://github.com/precice/tutorials/pull/882), [#894](https://github.com/precice/tutorials/pull/894). diff --git a/tools/tests/README.md b/tools/tests/README.md index f0e44adb8..a51921e4e 100644 --- a/tools/tests/README.md +++ b/tools/tests/README.md @@ -107,7 +107,7 @@ To reproduce the comparison locally, use the [same fieldcompare command](https:/ ```bash fieldcompare dir precice-exports/ reference-results-unpacked// \ --ignore-missing-reference-files \ - --exclude-files reference-results-metadata.txt \ + --exclude-files reference-results-metadata.md \ --ignore-unsupported-file-formats \ -rtol 3e-7 ``` @@ -177,7 +177,7 @@ The two options cannot be combined: defining any overrides to `reference_version The results will be added to a Git LFS, but you will need special push access: just use the aforementioned GitHub Actions workflow, instead. -Each generated reference archive contains a `reference-results-metadata.txt` file +Each generated reference archive contains a `reference-results-metadata.md` file inside its case directory. This file records the component versions and machine information used to generate that archive. @@ -289,7 +289,7 @@ Metadata and workflow/script files: - `docker-compose.template.yaml`: Describes how to prepare each test (Docker Compose service template) - `docker-compose.field_compare.template.yaml`: Describes how to compare results with fieldcompare (Docker Compose service template) - `components.yaml`: Declares the available components and their parameters/options - - `reference-results-metadata.txt.template`: Template for reporting the versions and machine used to generate each reference results archive + - `reference-results-metadata.md.template`: Template for reporting the versions and machine used to generate each reference results archive - `reference_versions.yaml`: List of arguments to use for generating the reference results - `tests.yaml`: Declares the available tests, grouped in test suites diff --git a/tools/tests/docker-compose.field_compare.template.yaml b/tools/tests/docker-compose.field_compare.template.yaml index 8a789b109..9b120d739 100644 --- a/tools/tests/docker-compose.field_compare.template.yaml +++ b/tools/tests/docker-compose.field_compare.template.yaml @@ -6,4 +6,4 @@ services: command: - /runs/{{ tutorial_folder }}/{{ precice_output_folder }} - /runs/{{ tutorial_folder }}/{{ reference_output_folder }} - - "-rtol {{ tolerance }} --ignore-missing-reference-files --exclude-files reference-results-metadata.txt --ignore-unsupported-file-formats --diff" + - "-rtol {{ tolerance }} --ignore-missing-reference-files --exclude-files reference-results-metadata.md --ignore-unsupported-file-formats --diff" diff --git a/tools/tests/generate_reference_results.py b/tools/tests/generate_reference_results.py index c2f3b4425..f6574d9aa 100644 --- a/tools/tests/generate_reference_results.py +++ b/tools/tests/generate_reference_results.py @@ -33,7 +33,7 @@ def create_reference_tar_gz( shutil.rmtree(staging) shutil.copytree(exports_dir, exports_staging) try: - (exports_staging / "reference-results-metadata.txt").write_text(metadata) + (exports_staging / "reference-results-metadata.md").write_text(metadata) with tarfile.open(output_filename, "w:gz") as tar: tar.add(exports_staging, arcname=stem) if iterations_logs: @@ -50,7 +50,7 @@ def create_reference_tar_gz( shutil.rmtree(logs_staging, ignore_errors=True) -def get_machine_informations(): +def get_machine_information(): def command_is_avail(command: str): try: rc = subprocess.call(['which', command], stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -59,37 +59,28 @@ def command_is_avail(command: str): return rc == 0 uname_info = "uname not available on the machine the systemtests were executed." - lscpu_info = "lscpu not available on the machine the systemtests were executed." if (command_is_avail("uname")): result = subprocess.run(["uname", "-a"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) if result.returncode == 0: uname_info = result.stdout - if (command_is_avail("lscpu") and command_is_avail("grep")): - result_lscpu = subprocess.run(["lscpu"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) - result = subprocess.run(["grep", "-v", "Vulner"], input=result_lscpu.stdout, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) - if result.returncode == 0: - lscpu_info = result.stdout - - return (uname_info, lscpu_info) + return uname_info def render_reference_results_info( archive_name: str, arguments_used: SystemtestArguments, time: str): - uname, lscpu = get_machine_informations() + uname = get_machine_information() render_dict = { 'arguments': arguments_used.arguments, 'archive_name': archive_name, 'time': time, 'uname': uname, - 'lscpu': lscpu, } jinja_env = Environment(loader=FileSystemLoader(PRECICE_TESTS_DIR)) - template = jinja_env.get_template("reference-results-metadata.txt.template") + template = jinja_env.get_template("reference-results-metadata.md.template") return template.render(render_dict) diff --git a/tools/tests/reference-results-metadata.md.template b/tools/tests/reference-results-metadata.md.template new file mode 100644 index 000000000..bc88bd9f2 --- /dev/null +++ b/tools/tests/reference-results-metadata.md.template @@ -0,0 +1,17 @@ + + +# Reference results + +- Archive: `{{ archive_name }}` +- Generated at: `{{ time }}` +- Host: `{{ uname }}` + +## System tests arguments used to generate the results + +| name | value | +| --- | --- | +{% for name,value in arguments.items() -%} +| `{{ name }}` | `{{ value }}` | +{% endfor -%} diff --git a/tools/tests/reference-results-metadata.txt.template b/tools/tests/reference-results-metadata.txt.template deleted file mode 100644 index 2e196c865..000000000 --- a/tools/tests/reference-results-metadata.txt.template +++ /dev/null @@ -1,33 +0,0 @@ - - -# Reference Results - -This file describes the reference results in `{{ archive_name }}` and includes -the arguments and machine used to generate them. - -## Archive - -| name | generated at | -|------|--------------| -| {{ archive_name }} | {{ time }} | - -## Arguments used to generate the results - -| name | value | -|------|------| -{% for name,value in arguments.items() -%} -| {{ name }} | {{ value }} | -{% endfor -%} - - -## Information about the machine - -### uname -a - -{{ uname }} - -### lscpu - -{{ lscpu }} \ No newline at end of file