Skip to content

Commit

Permalink
#295: Made notebook-tests mandatory for merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki committed Jun 24, 2024
1 parent 26b3acd commit 98304ad
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 25 deletions.
44 changes: 28 additions & 16 deletions .github/workflows/check_ci.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: CI Build

on:
push:
branches-ignore:
- "main"
pull_request:

jobs:
run_unit_tests:
run-unit-tests:
runs-on: ubuntu-latest

steps:
Expand All @@ -18,7 +16,7 @@ jobs:
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: "3.10"
poetry-version: '1.8.2'
poetry-version: "1.8.2"

- name: Run Unit Tests
run: >
Expand All @@ -28,14 +26,14 @@ jobs:
--override-ini=log_cli_level=INFO
test/unit
run_integration_tests:
run-integration-tests:
name: Integration Tests
environment: AWS_CI_TESTS
runs-on: ubuntu-latest
needs: run_unit_tests
needs: run-unit-tests

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -61,8 +59,7 @@ jobs:
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: "3.10"
poetry-version: '1.8.2'

poetry-version: "1.8.2"

- name: Run Integration Tests
run: >
Expand All @@ -76,15 +73,23 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY_SECRET }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}

run_notebook_tests:
approval-for-notebook-tests:
name: Run Jupyter Notebook Tests?
runs-on: ubuntu-latest
steps:
- name: Detect Running Notebook Tests
run: true
environment:
approve-test-execution

run-notebook-tests:
name: Jupyter Notebook Tests
if: "contains(github.event.head_commit.message, '[run-notebook-tests]')"
environment: AWS_SAGEMAKER
runs-on: ubuntu-latest
needs: run_unit_tests
needs: approval-for-notebook-tests

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -110,8 +115,7 @@ jobs:
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: "3.10"
poetry-version: '1.8.2'

poetry-version: "1.8.2"

- name: Run notebook tests
run: >
Expand All @@ -127,3 +131,11 @@ jobs:
SAAS_HOST: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_HOST }}
SAAS_ACCOUNT_ID: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_ACCOUNT_ID }}
SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }}

gate-2:
name: Gate 2 - Allow Merge
runs-on: ubuntu-latest
needs: [ run-unit-tests, run-integration-tests, run-notebook-tests ]
steps:
- name: Branch Protection
run: true
2 changes: 1 addition & 1 deletion doc/changes/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changes

* [2.1.0](changes_2.1.0.md)
* [unreleased](unreleased.md)
* [2.0.0](changes_2.0.0.md)
* [1.0.0](changes_1.0.0.md)
* [0.2.0](changes_0.2.0.md)
Expand Down
1 change: 1 addition & 0 deletions doc/changes/changes_2.1.0.md → doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ n/a
* #267: Switched CodeBuildWaiter to use tenacity
* #276: Started using the new ITDE Manager interface in the notebook-connector 0.2.9
* #282: Updated python version to Python 3.10
* #295: Made notebook-tests mandatory for merge
12 changes: 4 additions & 8 deletions doc/developer_guide/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
The project has two types of CI tests:
* Unit tests and integration tests which run in a Github workflow
* Special integration tests verifying the content of the Jupyter notebook files
* A system test which runs on a AWS Codebuild
* A system test which runs in a AWS Codebuild

All these tests need to pass before the approval of a Github PR.
The Github workflow will run on each push to a branch in the Github repository.

However, the notebook tests and the AWS Codebuild will only run after you push a commit containing a special string in the commit message, see the following sections.
However, the notebook tests and the AWS Codebuild will only run under specific conditions, e.g. manual approval or push a commit containing a special string in the commit message, see the following sections.

### Executing Notebook Tests
### Executing Jupyter Notebook Tests

Use the following git commands to execute the notebook tests:

```shell
git commit -m "[run-notebook-tests]" --allow-empty && git push
```
The regular CI build will ask for confirmation (aka. "review") before executing these tests, see [ETAJ developer guide](https://github.com/exasol/exasol-test-setup-abstraction-java/blob/main/doc/developer_guide/developer_guide.md#ci-build) for details.

### Executing AWS CodeBuild

Expand Down

0 comments on commit 98304ad

Please sign in to comment.