Skip to content
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

Merged

Conversation

tomuben
Copy link
Collaborator

@tomuben tomuben commented Nov 22, 2024

fixes #427

All Submissions:

  • Is the title of the Pull Request correct?
  • Is the title of the corresponding issue correct?
  • Have you updated the changelog?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Are you mentioning the issue which this PullRequest fixes ("Fixes...")
  • Before you merge don't forget to run all tests for all Exasol version, by adding [run all tests] to the commit message
  • Are the CLI usage examples up to date?

@tomuben tomuben marked this pull request as draft November 25, 2024 10:57
@tomuben tomuben force-pushed the refactoring/427_use_gh_merge_gate_from_tbx_for_slow_tests branch from 7400ccb to a55c379 Compare January 14, 2025 15:18
@tomuben tomuben temporarily deployed to manual-approval January 14, 2025 15:19 — with GitHub Actions Inactive
@tomuben tomuben marked this pull request as ready for review January 14, 2025 15:50
@tomuben tomuben changed the title #427: Use GH merge-gate from TBX for slow tests #427: Use GH approved for slow tests Jan 14, 2025
@tomuben tomuben temporarily deployed to manual-approval January 14, 2025 17:24 — with GitHub Actions Inactive
Copy link
Collaborator Author

@tomuben tomuben Jan 14, 2025

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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'
Copy link
Collaborator Author

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.

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

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

@tomuben tomuben changed the title #427: Use GH approved for slow tests #427: Implemented GH approval for slow tests Jan 14, 2025
name: Allow Merge
runs-on: ubuntu-latest
# If you need additional jobs to be part of the merge gate, add them below
needs: [ Tests ]
Copy link
Contributor

@tkilias tkilias Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
needs: [ Tests ]
needs: [ checks, tests ]

Copy link
Contributor

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did the second option.


Metrics:
needs: [ CI ]
needs: [ Tests ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
needs: [ Tests ]
needs: [ checks, tests ]

Copy link
Collaborator Author

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

name: Allow Merge
runs-on: ubuntu-latest
# If you need additional jobs to be part of the merge gate, add them below
needs: [ metrics ]
Copy link
Contributor

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.

Suggested change
needs: [ metrics ]
needs: [ checks, tests ]

To make dependencies clear, I propose to move job metrics to the end of the file.

uses: ./.github/workflows/tests_with_coverage.yml

metrics:
needs: [ tests, checks ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
needs: [ tests, checks ]
needs: [ checks, tests ]

@@ -23,3 +23,6 @@ jobs:
metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor

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?

@@ -23,3 +23,6 @@ jobs:
metrics:
needs: [ ci-job ]
uses: ./.github/workflows/report.yml

publish-docker-runnmer:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link
Contributor

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.

Copy link
Contributor

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'
Copy link
Contributor

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
Copy link
Contributor

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?

1. ci.yml and periodic_validation.yml
2. Slow tests and fast tests
@tomuben tomuben temporarily deployed to manual-approval January 15, 2025 16:34 — with GitHub Actions Inactive
uses: ./.github/workflows/fast_tests.yml

metrics:
needs: [ fast-tests, checks ]
Copy link
Contributor

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1+

Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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 ]
Copy link
Contributor

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 ]

Copy link
Contributor

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

@tomuben tomuben temporarily deployed to manual-approval January 17, 2025 11:25 — with GitHub Actions Inactive
uses: ./.github/workflows/fast_tests.yml

metrics:
needs: [ fast-tests, checks ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1+

uses: ./.github/workflows/fast_tests.yml

metrics:
needs: [ fast-tests, checks ]
Copy link
Contributor

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.

@tomuben tomuben merged commit c3c7fef into main Jan 17, 2025
117 checks passed
@tomuben tomuben deleted the refactoring/427_use_gh_merge_gate_from_tbx_for_slow_tests branch January 17, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GH approval required for slow tests
3 participants