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

#295: Made notebook-tests mandatory for merge #296

Merged
merged 20 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions .github/workflows/check_documentation_links.yaml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/check_version.yaml

This file was deleted.

53 changes: 36 additions & 17 deletions .github/workflows/check_ci.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
name: CI Build
name: CI

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

jobs:
run_unit_tests:
run-unit-tests:
name: Run Unit Tests
runs-on: ubuntu-latest

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

- name: Run shellcheck
run: ./scripts/build/shellcheck.sh

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: "3.10"
poetry-version: '1.8.2'
poetry-version: "1.8.2"

- name: Check Version Number
run: poetry run python3 -u "./scripts/build/check_release.py"

- name: Run Unit Tests
run: >
Expand All @@ -28,14 +33,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 +66,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 +80,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 +122,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 +138,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
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
name: Check Notebook Links
name: Referential Integrity

ckunki marked this conversation as resolved.
Show resolved Hide resolved
on:
push:
branches-ignore:
- "main"
pull_request:

jobs:
check_notebook_links:
check-links:
name: Find Broken Links in Documentation and Jupyter Notebooks
runs-on: ubuntu-latest

steps:

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

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: "3.10"
poetry-version: '1.8.2'

- name: Run build ai-lab tests
- name: Check Hyperlinks in Documentation
id: lychee
uses: lycheeverse/[email protected]
with:
fail: true
args: --verbose --no-progress 'doc/**/*.md' 'README.md'

- name: Check Hyperlinks in Jupyter Notebooks
run: >
poetry run pytest --check-links exasol/ds/sandbox/runtime/ansible/roles/jupyter/files/notebook/

15 changes: 0 additions & 15 deletions .github/workflows/shellcheck.yaml

This file was deleted.

1 change: 1 addition & 0 deletions doc/changes/changes_2.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Version: 2.1.0
* #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
Loading