| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Do we know if the internet test pass on GitHub actions runners? |
Sorry, something went wrong.
Once I get the GitHub Action passing without changes to the internet tests, I will add a commit that changes an internet test to check. (Right now, it fails when you don't change the internet tests because grep doesn't find anything and exits with a non-zero return code. Whoops.) |
Sorry, something went wrong.
There was a problem hiding this comment.
| run: if [[ $(git diff --name-only origin HEAD -- test/internet) ]]; then make test-internet -j2 V=1; fi | |
| run: | | |
| if [[ $(git diff --name-only origin HEAD -- test/internet) ]]; then | |
| make test-internet -j2 V=1; | |
| fi |
The only problem is that it will be green if there are no changes in test/internet, so it might not be practical to know if it really ran or not IMO. A solution would be (with fetch-depth: 0):
- name: Get changed test/internet files
id: check-internet
run: echo "::set-output name=changed::$(git diff --name-only origin/${{ github.base_ref || 'master' }} HEAD -- test/internet)"
- name: Test Internet
# Only run if files in test/internet have changed.
if: steps.check-internet.outputs.changed
run: make test-internet -j2 V=1But at this point, an action like https://github.com/tj-actions/changed-files could even be used.
Refs (-j2 -> -j): #40080 (comment)
Sorry, something went wrong.
There was a problem hiding this comment.
The only problem is that it will be green if there are no changes in test/internet, so it might not be practical to know if it really ran or not IMO.
I'm OK with that, especially if it keeps the workflow simple and light on dependencies.
Refs (-j2 -> -j): #40080 (comment)
I left a comment there but I'm pretty sure we don't want to do that.
Sorry, something went wrong.
There was a problem hiding this comment.
The multi-line suggestion is a good one. Right now, this isn't working though because of the way the workflow fetches from origin. So that if stuff might be going away. If not, I'll do it your way for sure. Thanks! Pondering the right solution...
Sorry, something went wrong.
There was a problem hiding this comment.
What made you add --exit-code?
Sorry, something went wrong.
There was a problem hiding this comment.
What made you add --exit-code?
git diff always exits with code 0, even if diff is empty.
With --exit-code it exits with code 1 if changes, otherwise 0.
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think we need that. The if [[ $( COMMAND ) ]] means "true if there is any output from COMMAND, otherwise false".
Sorry, something went wrong.
|
For fatal: bad revision 'origin', maybe fetch-depth: 0 in checkout would work? |
Sorry, something went wrong.
Yes, but I'm not sure how much overhead (and therefore additional time waiting for the job to complete) it would add. Do you have any idea?
That will only check the last commit. I want to check all commits in a PR. |
Sorry, something went wrong.
Approximately 1 minute vs 30 seconds for checkout. |
Sorry, something went wrong.
Argh, although I'm now realizing that comparing against origin/HEAD could have spurious results if the pull request branch isn't up to date with origin/HEAD. I guess I could rebase inside the workflow but that seems like it might have its own problems (like the entire workflow failing if the rebase fails--is that a feature or a bug?). |
Sorry, something went wrong.
|
We can simply compare between the SHA of the previous ("before"/"base") commit and the HEAD. This works for pull requests and pushes (and it's provided in github context). |
Sorry, something went wrong.
- name: Get changed test/internet files
id: check-internet
run: |
changes=$(git diff --name-only ${{ github.event.pull_request.base.sha }} HEAD -- test/internet)
[ $? -ne 0 ] && exit $?
echo "::set-output name=changes::$changes"
- name: Test Internet
# Only run if files in test/internet have changed.
if: steps.check-internet.outputs.changes
run: make test-internet -j2 V=1This should normally work. |
Sorry, something went wrong.
|
This started off as such a simple addition, but it's starting to seem like it will need a fair amount of stuff to make it work robustly and I wonder if this isn't the way to do it but to instead put it in its own workflow file. |
Sorry, something went wrong.
|
I also think this is the best solution. |
Sorry, something went wrong.
|
Added it as a daily/on-demand workflow for now. We can later improve it to run on pull requests and pushes when appropriate only (or not). |
Sorry, something went wrong.
|
Here's the workflow running on my fork: https://github.com/Trott/io.js/actions/runs/1226807643 |
Sorry, something went wrong.
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: "5 0 * * *" |
There was a problem hiding this comment.
Added it as a daily/on-demand workflow for now. We can later improve it to run on pull requests and pushes when appropriate only (or not).
I want to say that it's almost useless if you do it that way. It would just be impossible to run this workflow on a PR that changes the internet tests, and that's a shame, it loses all its usefulness IMO.
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "5 0 * * *" | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '5 0 * * *' | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| paths: | |
| - test/internet/** | |
| - deps/cares/** | |
| - lib/dns.js | |
| - lib/internal/dns/** | |
| - src/cares* | |
| - lib/dgram.js | |
| - lib/internal/dgram.js | |
| - src/*udp* | |
| - lib/*http* | |
| - lib/internal/http.js | |
| - lib/internal/http2/** | |
| - src/*http* | |
| - src/tcp* | |
| - deps/ng*/** | |
| push: | |
| paths: | |
| - test/internet/** | |
| - deps/cares/** | |
| - lib/dns.js | |
| - lib/internal/dns/** | |
| - src/cares* | |
| - lib/dgram.js | |
| - lib/internal/dgram.js | |
| - src/*udp* | |
| - lib/*http* | |
| - lib/internal/http.js | |
| - lib/internal/http2/** | |
| - src/*http* | |
| - src/tcp* | |
| - deps/ng*/** | |
| branches: | |
| - master | |
| - main | |
| - canary | |
| - v[0-9]+.x-staging | |
| - v[0-9]+.x |
Sorry, something went wrong.
There was a problem hiding this comment.
The additions you're proposing here may be worth doing, but we should probably keep it on a schedule too. Other changes may break internet tests (such as changes to cares or dns.js) and we might not notice for a long time. If it's a month later, it will be very useful to have daily results to go back to so we can immediately narrow the issue down to a single day's worth of commits.
My idea was that someone can manually launch the job on PRs if the PR branch is in the repo. (Or they can launch it on their own branch if it's in their repo.)
Sorry, something went wrong.
There was a problem hiding this comment.
By the way, the "run once a day and run it manually" mirrors what we do on Jenkins now, so they idea is that this would allow us to get rid of the Jenkins job.
Sorry, something went wrong.
There was a problem hiding this comment.
(Although it does seem like the Jenkins job runs much faster. Maybe I'm doing something wrong in the workflow and there's a way to have a persistent compile cache to speed things up or something.)
Sorry, something went wrong.
There was a problem hiding this comment.
I have updated the suggestion.
Sorry, something went wrong.
There was a problem hiding this comment.
If it's OK with you, I think my preference is to land this as-is and then incrementally add these files/paths over time. We've gone years and years without having these jobs run automatically, and there's always been certain concerns around running them routinely in CI. These concerns (don't want to hit a DNS, web, or other external service too much from our CI, for example) may not be well-founded, but just in case, I think an incremental approach is still the way to go.
Sorry, something went wrong.
There was a problem hiding this comment.
It's OK with me.
Sorry, something went wrong.
PR-URL: #40086 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #40086 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
PR-URL: #40086 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
| Back | FazBrowse Home | New Git URL |
Allows on-demand and nightly runs of the internet tests.