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

Clean up testsuite intermediate files #13700

Merged
merged 2 commits into from
Sep 23, 2024
Merged

Conversation

amcn
Copy link
Contributor

@amcn amcn commented Sep 21, 2024

I've been running the testsuite locally for various in-flight things and I noticed that it can pollute the repo with intermediate files in some cases.

The changes in this PR address this such that running the suite no longer produces these intermediate files.

@amcn amcn requested a review from jpakkane as a code owner September 21, 2024 10:15
@@ -212,6 +212,7 @@ def test_meson_runpython(self):
mesonout = self._run(python_command + [meson_command, 'runpython'] + cmd, env=env)
self.assertEqual(pyout, mesonout)

os.remove(script_file)
Copy link
Member

@dcbaker dcbaker Sep 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To ensure this gets cleaned up even if there's a failure, add self.addCleanup(os.remove, scriptfile) right after the with open(...): block enstead. That cleanup happens regardless of how the function exits

The common test case "268 install functions and follow symlinks"
requires that certain symlinks exist in order to function.

If one clones a fresh repo and executes run_single_test.py with
the aforementioned test as the target it will fail as the required
symlinks are not part of the repo.

Normally these symlinks are created and cleaned up when the
overall testsuite is run but this is not the case for
run_single_test.py

This commit calls the necessary creation and cleanup functions
in the case of run_single_test.py.
@dcbaker dcbaker merged commit 191b801 into mesonbuild:master Sep 23, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants