Repository navigation
ci: conditionally skip python and frontend tests - #12583
Conversation
e44de25 to
ad10911
Compare
Codecov Report
@@ Coverage Diff @@
## master #12583 +/- ##
==========================================
- Coverage 66.75% 66.67% -0.08%
==========================================
Files 1015 1015
Lines 49634 49634
Branches 4839 4970 +131
==========================================
- Hits 33131 33094 -37
- Misses 16380 16417 +37
Partials 123 123
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
8d3f9bf to
5e39697
Compare
5e39697 to
5262a77
Compare
amitmiran137
left a comment
There was a problem hiding this comment.
Wow this will reduce CI waiting time dramatically.
Thank you for that!
|
@ktmud could you help review and stamp it? |
|
You probably wouldn't want to ignore I'm also wondering what's the difference between this solution and using Github Action's built-in We can probably get away with something like this: name: E2E
on:
push:
branches-ignore:
- "dependabot/**/docs/**"
paths-ignore:
- "docs/**"
- *.md
- docker/**
- helm/**
pull_request:
paths-ignore:
- "docs/**"
- *.md
- docker/**
- helm/**# Python MySQL unit tests
name: Python MySQL
on:
push:
branches-ignore:
- "dependabot/npm_and_yarn/**"
paths:
- superset/**
- tests/**
- requirements/**
- scripts/**
- setup.py
pull_request:
paths:
- superset/**
- tests/**
- requirements/**
- scripts/**
- setup.py |
|
@ktmud using the github syntax causes the action to forever remain in a "pending" state which block PR merges for actions that are marked |
Right. Totally forgot about this... We've talked about this before, lol. |
|
Anyway, I still don't think you can skip |
There was a problem hiding this comment.
Can we maybe parameterize this script to avoid creating two largely identical files?
There was a problem hiding this comment.
Anyway, I still don't think you can skip
test/*.pyfor E2E tests.are we? I'm not seeing any changes to
superset-e2e.yml
I wanted to keep the scope of this PR as small as possible, hence didn't het add the E2E changes. Once this is merged I'll add similar logic to frontend and E2E tests.
There was a problem hiding this comment.
Another benefit of parameterizing this is to allow more advanced skipping in the future---for example, we may split/skip E2E tests based on product areas.
are we? I'm not seeing any changes to |
It was stated in the PR description as the reason for having two |
|
BTW, we should probably also skip |
|
Ah, I didn't read the PR description fully. I agree, since e2e is supposed to be out final catch-all check it should probably always run. Also there is code in |
Yes, I'll do this in a follow-up PR. |
dpgaspar
left a comment
There was a problem hiding this comment.
LGTM, just a non blocking comment, agree that E2E should run also on python changes
There was a problem hiding this comment.
nit: seems logically odd that a script named check_python_changes returns "False" if there were changes, assuming it's easier to detect if: steps.check.outcome == 'failure' maybe rename the script to a negative
There was a problem hiding this comment.
That's a good point also. I'll rename the files to be in line with what's being asserted.
5262a77 to
6e488cc
Compare
|
The |
8bc148a to
f10c40c
Compare
| # To check for python and frontend changes, run with CHECKS="python frontend" | ||
|
|
||
| URL="https://api.github.com/repos/${GITHUB_REPO}/pulls/${PR_NUMBER}/files" | ||
| FILES=$(curl -s -X GET -G $URL | jq -r '.[] | .filename') |
There was a problem hiding this comment.
nit: SC2086: Double quote to prevent globbing and word splitting.
* ci: conditionally skip python tests * parametrize check script and implement for frontend * add missing script * fix incorrect check * move CHECKS to ARGS and fix typo * fix SC2086 nit
SUMMARY
This PR changes Python CI workflows to skip unit test execution for PRs that don't have changes that are relevant for those workflows. Here we're leveraging
continue-on-errorto check if files relevant to unit tests have changed, namelyPython changes:
tests/*superset/*requirements/*.txtsetup.pyFrontend changes:
superset_frontend/*This is done to ensure that skipped workflows return a successful status for required checks despite not executing the expensive test steps. If any of the aforementioned file have changed, a failure exit code is triggered, which subsequent steps listen in on; if the check step returned a failure, the tests run, otherwise they are skipped.
To check changes, run
check_no_file_changes.shwith the following arguments (theGITHUB_REPOandPR_NUMBERenv variables need to be set):./check_no_file_changes.sh python./check_no_file_changes.sh frontend./check_no_file_changes.sh python frontend(order doesn't matter)E2E tests have not been included in this PR, as some steps there depend in
failure()which might need tweaking to run properly with this script.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Example of skipped frontend changes:

This shows the results for a PR with python changes:
When checking for both python and frontend changes on a PR with frontend changes, the following happens:
TEST PLAN
Tested to correctly detect frontend and python changes locally, as well as skip tests when they are not needed to run
ADDITIONAL INFORMATION