Repository navigation
Conversation
e70b16d to
4abdb6a
Compare
COMMIT_MESSAGE in build_tools/azure/get_commit_message.pySELECTED_TESTS in unit-tests.yml to allow the use of [all random seeds]
SELECTED_TESTS in unit-tests.yml to allow the use of [all random seeds]SELECTED_TESTS in unit-tests.yml to allow the use of [all random seeds] marker
4abdb6a to
cbd1276
Compare
SELECTED_TESTS in unit-tests.yml to allow the use of [all random seeds] markerSELECTED_TESTS in unit-tests.yml to allow the use of [all random seeds] marker in GHA
… random seeds]` marker
cbd1276 to
982efb0
Compare
c4420ca to
c1639d5
Compare
test_kmeans_convergence test_gnb_prior
c1639d5 to
6938e38
Compare
lesteve
left a comment
There was a problem hiding this comment.
I like the general direction
It seems like in your last commit the CI is red see build log
The problem seems to be a missing quote around the test names
-k test_kmeans_convergence or test_gnb_prior should be -k "test_kmeans_convergence or test_gnb_prior"
| "get_commit_message not supported outside Azure for now, " | ||
| "returning empty commit message" | ||
|
|
||
| if "COMMIT_MESSAGE" in os.environ or os.environ.get("GITHUB_ACTIONS", False): |
There was a problem hiding this comment.
I would do something like, wording improvements more than welcome.
if "BUILD_SOURCEVERSIONMESSAGE" not is os.environ:
raise RuntimeError("This legacy script should only be used on Azure. On GitHub actions, use the 'COMMIT_MESSAGE' environment variable")There was a problem hiding this comment.
Fixed in 7660c6c (mix between my solution and yours).
| ) | ||
| return "" | ||
|
|
||
| logger.debug("`commit_message` coming from Azure") |
There was a problem hiding this comment.
I think this logging is not really necessary, if you get an error above you are not in Azure, if you don't get an error, well then you are on Azure
| <test_name_2> | ||
| ... | ||
| """ | ||
| if "SELECTED_TESTS" in os.environ or os.environ.get("GITHUB_ACTIONS", False): |
There was a problem hiding this comment.
I would use a similar logic as for the get_commit_message.py, something like this:
if "BUILD_REASON" not in os.environ:
raise RuntimeError("This legacy script is supposed to be used only on Azure. On GitHub Actions use the `SELECTED_TESTS` environment variable directly")There was a problem hiding this comment.
Fixed in 7660c6c (mix between my solution and yours).
| print(f"selected tests: {selected_tests}") # helps debugging | ||
| else: | ||
| print("no selected tests") | ||
| # set the environment variable to be propagated to other steps |
There was a problem hiding this comment.
Is there a good reason to change this? As a reviewer any changes that requires me having to think will make me unhappy 😅. Also since this is a legacy script, it will go away soonish and I would tweak it only when really needed.
There was a problem hiding this comment.
I wanted to standardize with get_commit_message.py: the variable SELECTED_TESTS is always set, even if there is no selected tests.
With the previous implementation, SELECTED_TESTS is only set when there is selected tests.
In addition, as get_commit_message.py, i wanted to call it directly in test_script.sh.
| echo EOF | ||
| } >> "${GITHUB_OUTPUT}" | ||
|
|
||
| retrieve-selected-tests: |
There was a problem hiding this comment.
The logic looks good.
I am wondering whether moving this to a step in the retrieve-commit-message would be a good idea.
- upside: all the commit related info is in the same job. reusing the same job rather than launching a new one so a tiny bit quicker (but honestly not that crucial)
- downside: you probably need to export the commit message as environment variable into both
GITHUB_ENVandGITHUB_OUTPUTbut that seems fine.
There was a problem hiding this comment.
Up to you. We can easily merge the two jobs, but IMO, 1 job per task is a more explicit approach.
test_kmeans_convergence test_gnb_prior
test_kmeans_convergence test_gnb_prior
test_kmeans_convergence test_gnb_prior
d4765da to
4dc5952
Compare
test_kmeans_convergence test_gnb_prior
| - name: Combine coverage reports from parallel test runners | ||
| run: bash -l build_tools/azure/combine_coverage_reports.sh | ||
| if: ${{ env.COVERAGE == 'true' }} | ||
| if: ${{ needs.retrieve-selected-tests.outputs.tests == ''}} |
There was a problem hiding this comment.
I think you still need to check ${{ env.COVERAGE }} some CI builds have COVERAGE: 'false', one reason is that measuring coverage has a significant overhead e.g. on Windows which makes the CI slower.
Right now, for simplicity I would not bother checking the selected tests. I would compute coverage and upload it, the coverage will be very low because you ran only a few tests but that's fine since coverage is not a required check.
I would go as far as saying that it's actually a feature, to remember you that you did not run the full CI but only a small number of tests.
There was a problem hiding this comment.
For further reference by removing the if selected-tests is empty, the combine_coverage_reports.sh was giving an error:
No data to combine
Not sure why but fair enough, let's leave it for later ...
test_kmeans_convergence test_gnb_prior
| # Write selected tests to `GITHUB_OUTPUT` | ||
| with open(os.environ["GITHUB_OUTPUT"], "a") as file: | ||
| file.write(f"tests={selected_tests}\n") | ||
| env: |
There was a problem hiding this comment.
I would move the env section before the run I find it slightly more natural, first "here are the environement variables", second "now run this script"
test_kmeans_convergence test_gnb_prior
test_kmeans_convergence test_gnb_prior
test_kmeans_convergence test_gnb_prior
|
I double-checked the |
SELECTED_TESTS in unit-tests.yml to allow the use of [all random seeds] marker in GHA[all random seeds] commit marker in GHA
|
Let's merge this one thanks! |
Co-authored-by: Loïc Estève <[email protected]>
Reference Issues/PRs
Partially addresses #32434.
What does this implement/fix? Explain your changes.