Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup the contents of the system tests archives #629

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Move and extend the reference_results.metadata
MakisH committed Feb 21, 2025

Verified

This commit was signed with the committer’s verified signature.
MakisH Gerasimos Chourdakis
commit b68ae694457c6db72be25641f9579f0720de7254
2 changes: 1 addition & 1 deletion tools/tests/README.md
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ Metadata and workflow/script files:
- `docker-compose.template.yaml`: Describes how to prepare each test (Docker Componse 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.template`: Template for reporting the versions used to generate the reference results
- `reference_results_metadata.template`: Template for reporting the versions used to generate the reference results
- `reference_versions.yaml`: List of arguments to use for generating the reference results
- `tests.yaml`: Declares the available tests, grouped in test suites
17 changes: 12 additions & 5 deletions tools/tests/generate_reference_results.py
Original file line number Diff line number Diff line change
@@ -32,20 +32,26 @@ def command_is_avail(command: str):

return rc == 0
uname_info = "uname not available on the machine the systemtests were executed."
lsb_info = "lsb_release 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("lsb_release")):
result = subprocess.run(["lsb_release", "-a"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
if result.returncode == 0:
lsb_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, lsb_info, lscpu_info)


def render_reference_results_info(
@@ -69,16 +75,17 @@ def sha256sum(filename):
'time': time,
'name': reference_result.path.name,
})
uname, lscpu = get_machine_informations()
uname, lsb, lscpu = get_machine_informations()
render_dict = {
'arguments': arguments_used.arguments,
'files': files,
'uname': uname,
'lscpu': lscpu,
'lsb': lsb,
'lscpu': lscpu
}

jinja_env = Environment(loader=FileSystemLoader(PRECICE_TESTS_DIR))
template = jinja_env.get_template("reference_results.metadata.template")
template = jinja_env.get_template("reference_results_metadata.template")
return template.render(render_dict)


@@ -142,7 +149,7 @@ def main():

# write readme
for tutorial in reference_result_per_tutorial.keys():
with open(tutorial.path / "reference_results.metadata", 'w') as file:
with open(tutorial.path / "reference-results/reference_results_metadata.md", 'w') as file:
ref_results_info = render_reference_results_info(
reference_result_per_tutorial[tutorial], build_args, current_time_string)
logging.info(f"Writing results for {tutorial.name}")
Original file line number Diff line number Diff line change
@@ -23,12 +23,26 @@ We also include some information on the machine used to generate them
{% endfor -%}


## Information about the machine
## Platform information

### uname -a
### Operating system

`uname -a` returns:

```
{{ uname }}
```

`lsb_release -a` returns:

```
{{ lsb }}
```

### Hardware

### lscpu
`lscpu` returns:

{{ lscpu }}
```
{{ lscpu }}
```