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

External tests script refactor #14064

Merged
merged 2 commits into from Apr 28, 2023
Merged

External tests script refactor #14064

merged 2 commits into from Apr 28, 2023

Conversation

r0qs
Copy link
Member

@r0qs r0qs commented Mar 22, 2023

Extracted from #13873 (comment).
The script allows running external tests by name (e.g. one, multiple or all external tests) and automatically detects their configuration scritps. I prefered to detect the configuration scripts automatically instead of hardcode the available external tests, to allow us to add/remove new tests without the need to modify the runner script.

The idea is that this script will be used as part of PR #13873 to run the external tests locally or via CI.

@r0qs r0qs mentioned this pull request Mar 22, 2023
3 tasks
test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
test/externalTests.sh Outdated Show resolved Hide resolved
@r0qs r0qs marked this pull request as ready for review March 30, 2023 14:07
@r0qs r0qs requested a review from nikola-matic April 11, 2023 10:32
nikola-matic
nikola-matic previously approved these changes Apr 11, 2023
Copy link
Collaborator

@nikola-matic nikola-matic left a comment

Choose a reason for hiding this comment

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

Squash squash squash.
Some of the things I guess could be written in a more 'Pythonic' way, but honestly, it just makes the code less readable to me, so I'm perfectly fine with the way it is currently. Also, seeing as this doesn't really impact the CI at the moment, I'm fine with merging this and then improving incrementally when needed.

test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
@r0qs r0qs mentioned this pull request Apr 19, 2023
test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
test/external_tests.py Outdated Show resolved Hide resolved
scripts/common/shell_command.py Outdated Show resolved Hide resolved
Copy link
Member

@cameel cameel left a comment

Choose a reason for hiding this comment

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

I'd still recommend removing the wrapper, but other than that, there are no major issues here.

Copy link
Member

@cameel cameel left a comment

Choose a reason for hiding this comment

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

It's still using the shell to run the command. Getting rid of that was an important part of getting rid of the wrapper.

test/external_tests.py Outdated Show resolved Hide resolved
Copy link
Member

@cameel cameel left a comment

Choose a reason for hiding this comment

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

I was about to merge this, but at the last moment noticed a serious problem. The script stops after running a single test. It's easy to fix though.

test/external_tests.py Outdated Show resolved Hide resolved
@cameel cameel enabled auto-merge April 28, 2023 14:46
@cameel cameel merged commit 8be32f2 into develop Apr 28, 2023
57 checks passed
@cameel cameel deleted the external-tests-refactor branch April 28, 2023 15:25
raise ExternalTestNotFound(
f"External test(s) not found: {', '.join(unrecognized_tests)}"
)
run_test_scripts(
Copy link
Member Author

@r0qs r0qs Apr 28, 2023

Choose a reason for hiding this comment

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

Just noticed that without the return this will now always raise the ExternalTestNotFound exception. Will push the fix.

Copy link
Member Author

Choose a reason for hiding this comment

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

See: #14170

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants