-
Notifications
You must be signed in to change notification settings - Fork 2
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
#427: Implemented GH approval for slow tests #428
#427: Implemented GH approval for slow tests #428
Conversation
7400ccb
to
a55c379
Compare
and use matrix-python.yml in tests_with_coverage.yml
.github/workflows/matrix-python.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From
tbx workflow install matrix-python
without modification
.github/workflows/report.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From
tbx workflow install report
without modification
.github/workflows/gh-pages.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From
tbx workflow gh-pages
without modification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly from
tbx workflow install checks
Only removed execution of unit test + upload of coverage -> Is now handled in tests_with_converage.yml
Slow-Tests: | ||
name: Slow | ||
if: github.event_name != 'pull_request' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not ideal, but ci.yml
is also executed by a CRON schedule, and it would hang otherwise. I'am open for suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean with hang?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the condition not pull request would deactivate this job in pull requests events. cron is a different event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we actually want is the deactivate the approval for automated checks like cron or push to main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think, that is probably only possible if we split up the tests into two workflow files, one for fast and one for slow and add the manual approval in the caller and for the automated stuff we have a different caller as for the PR CI. I see iteration three coming of the plan
.github/workflows/ci.yml
Outdated
name: Allow Merge | ||
runs-on: ubuntu-latest | ||
# If you need additional jobs to be part of the merge gate, add them below | ||
needs: [ Tests ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs: [ Tests ] | |
needs: [ checks, tests ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative you can also make Approval depend on metrics and metrics depends on tests and checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the second option.
.github/workflows/ci.yml
Outdated
|
||
Metrics: | ||
needs: [ CI ] | ||
needs: [ Tests ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs: [ Tests ] | |
needs: [ checks, tests ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the second option from comment above
.github/workflows/ci.yml
Outdated
name: Allow Merge | ||
runs-on: ubuntu-latest | ||
# If you need additional jobs to be part of the merge gate, add them below | ||
needs: [ metrics ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow merge should not depend on report / metrics.
We still have incidents in which metrics / KPIs / report fails for some reason and want to be able to develop and merge PRs, though.
So for now: creating the reports is optional and should not prevent to merge.
needs: [ metrics ] | |
needs: [ checks, tests ] |
To make dependencies clear, I propose to move job metrics
to the end of the file.
.github/workflows/ci.yml
Outdated
uses: ./.github/workflows/tests_with_coverage.yml | ||
|
||
metrics: | ||
needs: [ tests, checks ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs: [ tests, checks ] | |
needs: [ checks, tests ] |
@@ -23,3 +23,6 @@ jobs: | |||
metrics: | |||
needs: [ ci-job ] | |||
uses: ./.github/workflows/report.yml | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As tests have been moved out from checks.yml
, then secrets no longer need to be inherited to checks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand: As tests have been moved out from checks.yml
, then pr-merge maybe needs to execute tests individually?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the name of ci-job
should maybe changed to "checks", then?
.github/workflows/pr-merge.yml
Outdated
@@ -23,3 +23,6 @@ jobs: | |||
metrics: | |||
needs: [ ci-job ] | |||
uses: ./.github/workflows/report.yml | |||
|
|||
publish-docker-runnmer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publish-docker-runnmer: | |
publish-docker-runner: |
@@ -7,39 +7,48 @@ on: | |||
required: false | |||
|
|||
jobs: | |||
build-matrix: | |||
name: Generate Build Matrix | |||
uses: ./.github/workflows/matrix-python.yml | |||
|
|||
Tests: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use unified names either capitalized or lower case but not mixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job only seems to execute unit tests and should be named accordingly.
Slow-Tests: | ||
name: Slow | ||
if: github.event_name == 'pull_request' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose to rename the check for manual approval, as it does not actually execute tests but only asks for a manual approval and other jobs then depend on this approval with needs
.
needs: Slow-Tests
sounds strange.
Candidates:
needs: Approve-Slow-Tests
needs: Manual-Approval
uses: ./.github/workflows/test_db_versions_all_tests.yml | ||
Test-Python-Versions: | ||
needs: Slow-Tests | ||
uses: ./.github/workflows/test_python_version.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the name test_python_version.yml
of the script not very expressive.
The job inside says
name: Run Tests with Python ${{ matrix.python_version }} and Exasol ${{ matrix.exasol_version }}
Still, I cannot tell, if these tests overlap with other groups of tests (e.g. include unit tests) or in which way they are different. Additionally, matrix-python.yml
creates build matrix including multiple python versions. In which way are these different from test_python_version.yml
?
.github/workflows/ci.yml
Outdated
uses: ./.github/workflows/fast_tests.yml | ||
|
||
metrics: | ||
needs: [ fast-tests, checks ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we would have slow-tests here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use the same or at least a similar name for the job as for the file.
currently metrics calls report.yml
.
@@ -1,24 +1,56 @@ | |||
name: CI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow .github/workflows/build-and-publish.yml
references different secrets:
secrets.PYPI_TOKEN
and secrets.GITHUB_TOKEN
.
The first one is passed as a parameter to the workflow while the second one seems to be inherited.
I propose to unify this and to only use 1 mechanism.
@@ -19,7 +19,7 @@ jobs: | |||
fetch-depth: 0 | |||
|
|||
- name: Setup Python & Poetry Environment | |||
uses: exasol/python-toolbox/.github/actions/python-environment@0.17.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some workflows use dashes -,
e.g. build-and-publish.yml
some underscores _
, e.g. test_db_versions_all_tests.yml
.
Could you please unify all workflows to use the same separator?
I propose dashes -
.
Lint: | ||
name: Linting (Python-${{ matrix.python-version }}) | ||
needs: [ Version-Check ] | ||
needs: [ Version-Check, build-matrix ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use unified style for job names?
Either capitalized or lower case only?
I propose capitalized with Dashes.
runs-on: ubuntu-latest | ||
# If you need additional jobs to be part of the merge gate, add them below | ||
needs: [ metrics, slow-tests ] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow Merge should not depend on metrics
…h_merge_gate_from_tbx_for_slow_tests_1 # Conflicts: # doc/changes/unreleased.md
.github/workflows/ci.yml
Outdated
uses: ./.github/workflows/fast_tests.yml | ||
|
||
metrics: | ||
needs: [ fast-tests, checks ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1+
.github/workflows/ci.yml
Outdated
uses: ./.github/workflows/fast_tests.yml | ||
|
||
metrics: | ||
needs: [ fast-tests, checks ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use the same or at least a similar name for the job as for the file.
currently metrics calls report.yml
.
fixes #427
All Submissions:
[run all tests]
to the commit message