-
Notifications
You must be signed in to change notification settings - Fork 7
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
Continuous integration: tests on GitHub runner #11
Conversation
test to pass
How do I go look at the tests? |
The GitHub action specified in If all tests pass, the process finishes successfully, and the badge will be green (tests passing). If something is amiss (at least one test fails), the process will also fail, informing you of a potential issue; the badge will be red. The VM is temporary and disappears after the action is run. |
I clicked the badge and it's just an image? Is there no log of how the testing went? |
You can see the log in the 'Actions' tab here on GitHub. |
Here's how that looks on my fork: https://github.com/slobentanzer/sctk/actions |
How will this look in the event of a PR? Will there be an automated thing at the bottom with test results? Is there some way to have the readme badge take the clicker to the set of tests the badge is in reference to? |
You can run automated tests that are added to the PR; that's what I would suggest. They will appear in the review section as automated checks. I haven't done this yet on my ow repos, but have seen it a few times and it seems straightforward. E.g. in the scanpy repository.
Not in the way this is implemented. The svg is generated by GitHub just as a render of the Action either passing or failing, not much room for customisation. I want to add more badges, and some services (e.g. codeclimate) offer more flexibility in the badges. We can open a discussion on what to add / use involving more people from your side. |
Does the automated testing on PR need to be somehow set up from the repo, or will it work in the current configuration? The Scanpy badge images are links. https://raw.githubusercontent.com/scverse/scanpy/master/README.md |
The yaml file in the workflows directory is the setup of the action. I think there are general settings to allow / prevent running actions, but the code itself should be enough to trigger the runner.
I understand what you mean now. You can have the badge link wherever you want, but where would we link in case of the test suite? To the actions tab, or to the test directory on GitHub? We could also link to the testing section of the contributor guide (which we need to add). |
So you're saying that in the current form, a PR should trigger the tests, and they should be displayed clearly within the PR? Ideally it would direct right to the logs of the testing that the badge is referring to. |
The basic application is: upon PR or push to This can then be used for downstream applications:
There is a difference between where the badge directs (freely configurable via the markdown link), and how the automated review is displayed. See for example the most recent PR on scanpy for a number of automated checks and how they are displayed: scverse/scanpy#2575 |
commit and push changes
Exactly, that scanpy PR is a good example of what I hope will show up when a PR is made here. I'm inferring from context that it should? Ideally the badge would link to the latest test: https://github.com/slobentanzer/sctk/actions/runs/5714779629 |
scanpy use an Azure runner (separate cloud-based solution) that allows more fine-tuning of the workflows. But in general, this is how it should look. I would go ahead with what is possible through GitHub actions for now, as it is much easier to implement.
I think GitHub actions do not provide this information to automatically link to the latest test. Linking the actions page is an option for the badge on the README; in the case of automated PR checks (as in the scanpy PR, see e.g. the first one, "Pull Request Validation"), the "Details" link will automatically take the user to the latest test. |
Let me know when you're happy with this |
I would be happy to merge. I have not used the automatic PR check, so I'd be interested to see how that works. For that we will need to merge and setup the procedure in the teichlab upstream. We can use another PR to test. |
What needs to be done once this gets merged? I was under the impression that it would work as is, minus changing the URLs to badges and tests. |
Your impression is correct, I think we only need to update the URLs from |
@ktpolanski one more thing just occurred to me: you will need to update the Workflow permissions (repository settings, Actions, General) to allow the workflow action to "read and write" to make the coverage part of the Action functional. |
You can in principle have variables on the runner to account for the branch, but this complicates things quite a bit. Since I personally have the opinion that long running feature branches are bad practise, and that any single feature branch can be automatically checked via the PR when it wants to be merged, I would advise against that.
Yes, your settings are already correct. Note that it would have passed this time without the setting as well, since the coverage has not changed. The action needs the write permission only when it would actually push something, i.e., when the test coverage increases or decreases. |
Yeah but ideally this would make a forker's life easy. They spin off a fork, they do some stuff, the badge updates to let them know that things are fine or not fine. Avoid a surprise once the PR is put in. |
That said, I'm not sure that what I want is even possible. My relative link of |
I would rather advise contributors to just run the test suite locally. If they want to develop the package, they will need to do this in any case. This also makes it possible to test without pushing, which I find I often want to do. |
Establishes a simple CI pipeline that runs all tests on a GitHub runner in case of a push to master or a PR.
Adds a badge for the status of the pipeline to the README.