Skip to content

Commit

Permalink
#22: Added comment on using fixtures from pytest-plugin pytest-exaso…
Browse files Browse the repository at this point in the history
…l-saas (#24)
  • Loading branch information
ckunki authored Jun 12, 2024
1 parent 6e53107 commit d8670e2
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Exasol Python Extension Common

A package with common functionality, shared by Exasol Python Extensions.
A package with common functionality, shared by Exasol Python Extensions, e.g.
* [transformers-extension](https://github.com/exasol/transformers-extension)
* [sagemaker-extension](https://github.com/exasol/sagemaker-extension)

See
* [User Guide](doc/user_guide/user-guide.md)
## Features

A deployer for script language containers (SLC) to be used by UDF-based extensions of Exasol database requiring a special SLC.

## More documentation

* User Guide
* [Developer Guide](doc/developer-guide.md)
* [User Defined Functions (UDF)](https://docs.exasol.com/db/latest/database_concepts/udf_scripts.htm)
* [Script Language Containers (SLC)](https://github.com/exasol/script-languages-release/)
5 changes: 5 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@
## Refactorings

* #15: Used plugin pytest-saas


## Documentation

* #22: Added comment on using fixtures from pytest-plugin `pytest-exasol-saas`
42 changes: 42 additions & 0 deletions doc/developer-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Python Extension Common (PEC) Developer Guide

## Pytest Plugins

PEC declares a dependency to pytest plugin `pytest-exasol-saas` which are maintained in GitHub repository [pytest-plugins/pytest_saas](https://github.com/exasol/pytest-plugins/tree/main/pytest-saas/).

This plugin makes additional fixtures available that are used in the integration tests of PEC.
See files in folder [test/integration](../tree/main/test/integration):

* `conftest.py`
* `test_language_container_deployer_saas.py`
* `test_language_container_deployer_saas_cli.py`

## Running Tests in CI Builds

The test cases in PEC are separated in two groups.

| Group | Execution | Name of gating GitHub workflow |
|-----------------------------|-----------------------------------------|--------------------------------|
| G1) Fast and cheap tests | On each push to your development branch | Gate 1 - Regular CI |
| G2) Slow or expensive tests | Only on manual approval, see below | Gate 2 - Allow Merge |

This enables fast development cycles while still protecting the main branch against build failures.

For PEC group G2 particularly contains the tests involving Exasol SaaS infrastructure which are creating costs for the database instances temporarily created during test execution.

Group G2 is guarded by a dedicated [GitHub Enviroment](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#required-reviewers) requiring **manual approval** before these tests are executed.

Each of the groups results in a final gating GitHub workflow job that is added to the branch protection of branch `main`.

So in order to merge a branch to `main` branch, the tests of both groups need to be executed and to have terminated succesfully.

### Approving Slow Tests

To approve executing the tests in group G2
* Open your pull request in GitHub
* Scroll to section "Checks"
* Locate pending tasks, e.g. "Ask if Slow or Expensive Tests (e.g. SaaS) Should be Run"
* Click the link "Details" on the right-hand side
* Click "Review pending Deplopyments"
* Select the checkbox "slow-tests"
* Click the green button "Approve and deploy"
3 changes: 3 additions & 0 deletions error_code_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
error-tags:
PEC:
highest-index: 0

0 comments on commit d8670e2

Please sign in to comment.