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

introduce shorter timeout in test.yml #175

Merged
merged 9 commits into from
Apr 8, 2024
Merged

Conversation

martinschorb
Copy link
Contributor

When playing around with a repository created from this template, a GUI test ended up in an infinite loop.
The default timeout of 6h and the 3x3 matrix to test different OSes and Python version then leads to a quick exhaustion of the time available for Github actions.
Since this repo is directed to beginners, I assume this can happen more often, so I propose a shorter timeout to minimize such problems.

Thanks!

@Czaki
Copy link
Contributor

Czaki commented Mar 15, 2024

Sounds like a good idea, but I think that we may want to put information about timeout somewhere (maybe in readme with link to github docs?)

add information on CI timeout to README.md
@martinschorb
Copy link
Contributor Author

Maybe 30 minutes is a bit tight looking at the results from the last run. Should we choose 45 or 60?

@DragaDoncila DragaDoncila requested a review from Czaki March 20, 2024 00:47
@Czaki
Copy link
Contributor

Czaki commented Mar 20, 2024

Ok. I think wrongly understood you initially. I think that you want to set timeout in {{cookiecutter.plugin_name}}/.github/workflows/test_and_deploy.yml file.

Because this workflow file is used in template output.

Or you have a problem with running tests of this repository?

@martinschorb
Copy link
Contributor Author

Sorry, my mistake. You initially got it right, but I obviously modified the wrong file.
Let me fix this.

this avoids using large amounts of CI time when playing with a plugin draft.
.github/workflows/test.yml Outdated Show resolved Hide resolved
@martinschorb
Copy link
Contributor Author

Any idea what is going on here? Looks like a git problem when setting up the plugin.

@DragaDoncila
Copy link
Collaborator

Hmm @martinschorb I think what's happening is that the workflow file has lost its newline at the end of the file, so the pre-commit that runs on the built plugin fails. You should be able to fix it by adding a newline back to the end of test_and_deploy.yml.

@AJFSalomon
Copy link
Contributor

Hmm @martinschorb I think what's happening is that the workflow file has lost its newline at the end of the file, so the pre-commit that runs on the built plugin fails. You should be able to fix it by adding a newline back to the end of test_and_deploy.yml.

Actually, I think it's the opposite: a newline has been added at the end of test_and_deploy.yml that wasn't there before. I am really not sure how this works or why the tests fail in the current state, but I would try to remove it and see if the tests pass.

I tried to do the modification myself, but I couldn't push the changes to this PR. Maybe @martinschorb or @Czaki can do it.

@AJFSalomon
Copy link
Contributor

I went through the test logs and I think the problem comes from the end of the generated `test_and_deploy.yml' file, pre-commit fails with the "fix end of files" hook. I think the cookiecutter is producing an excess new line:

E           Failed: pre-commit failed with output:
E           check docstring is first.................................................Passed
E           fix end of files.........................................................Failed
E           - hook id: end-of-file-fixer
E           - exit code: 1
E           - files were modified by this hook
E           
E           Fixing .github/workflows/test_and_deploy.yml
E           
E           trim trailing whitespace.................................................Passed
E           check yaml...............................................................Passed
E           ruff.....................................................................Passed
E           black....................................................................Passed
E           napari-plugin-checks.....................................................Passed
E           pre-commit hook(s) made changes.
E           If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
E           To run `pre-commit` as part of git workflow, use `pre-commit install`.
E           All changes made by hooks:
E           diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml
E           index d6e4adb..fcef2b4 100644
E           --- a/.github/workflows/test_and_deploy.yml
E           +++ b/.github/workflows/test_and_deploy.yml
E           @@ -89,4 +89,3 @@ jobs:
E                      git tag
E                      python -m build .
E                      twine upload dist/*
E           -
E           
E           errror:

tests/test_create_template.py:119: Failed
______________________ test_pre_commit_validity[y-y-n-n] _______________________

@Czaki Czaki merged commit 36dd874 into napari:main Apr 8, 2024
9 checks passed
This was referenced Apr 8, 2024
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.

4 participants