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

Add scripttest.yml #7105

Merged
merged 4 commits into from
Oct 26, 2022
Merged

Add scripttest.yml #7105

merged 4 commits into from
Oct 26, 2022

Conversation

drew2a
Copy link
Collaborator

@drew2a drew2a commented Oct 25, 2022

This PR closes #7093 and partially #7085

The Idea to test scripts in the ./scripts/ folder is simple: run each script for 10s and if there are no errors, then these scripts are considered to be "correct".

For implementing this solution 2 problems need to be solved:

  1. To run a script for 10s (solved by adding the timeout action, which is an adapted version of linux timeout command).
  2. To make a script fragile. It is necessary because these scripts use the asyncio event loop, and errors raised inside the loop don't kill the process (solved by adding the make_async_loop_fragile function).

The checks run on each PR push by calling the scripptest.yml workflow. The average duration of the check is about 1m.

Also, this PR fixes the pyenv action by using the freshest version from the original repo.

Scripts fixed:

  1. run_bandwidth_crawler.py
  2. run_exit_node.py
  3. disseminator.py
  4. seeder.py

Refs:

@drew2a drew2a force-pushed the feature/7093 branch 5 times, most recently from d42d4da to d07be83 Compare October 26, 2022 09:17
@drew2a drew2a marked this pull request as ready for review October 26, 2022 11:37
@drew2a drew2a requested a review from a team as a code owner October 26, 2022 11:37
@drew2a drew2a requested review from xoriole and devos50 and removed request for a team October 26, 2022 11:37
scripts/exit_node/run_exit_node.py Outdated Show resolved Hide resolved
scripts/experiments/tunnel_community/speed_test_e2e.py Outdated Show resolved Hide resolved
scripts/seedbox/disseminator.py Outdated Show resolved Hide resolved
scripts/bandwidth_crawler/run_bandwidth_crawler.py Outdated Show resolved Hide resolved
scripts/exit_node/run_exit_node.py Outdated Show resolved Hide resolved
@drew2a drew2a merged commit bdf1121 into Tribler:main Oct 26, 2022
@drew2a drew2a deleted the feature/7093 branch October 26, 2022 14:57
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.

Add a GitHub Action for PR to ensure that scripts/* are not broken
2 participants