-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compatible: Deprecate integration_test_charm.yaml
- Loading branch information
1 parent
0e591ba
commit aada62e
Showing
16 changed files
with
99 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
.github/workflows/integration_test_charm_deprecation_notice.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Deprecation notice | ||
|
||
## Components that are deprecated | ||
These components are deprecated & will be removed in a future release | ||
- integration_test_charm.yaml | ||
- python/pytest_plugins/pytest_operator_cache | ||
- python/pytest_plugins/pytest_operator_groups | ||
- python/pytest_plugins/allure_pytest_collection_report | ||
- python/pytest_plugins/github_secrets | ||
- python/pytest_plugins/microceph | ||
|
||
## Migration instructions | ||
### integration_test_charm.yaml | ||
Use `charmcraft test`: https://canonical-charmcraft.readthedocs-hosted.com/en/stable/reference/commands/test/ | ||
|
||
And concierge: https://github.com/jnsgruk/concierge | ||
|
||
Example: https://github.com/canonical/mysql-router-k8s-operator/pull/379 | ||
|
||
### python/pytest_plugins/pytest_operator_cache | ||
In integration tests, instead of calling `ops_test.build_charm`, assume the *.charm file exists and fail the test if the *.charm file is missing. The charm should be built outside of the test | ||
|
||
When running tests locally, if you would like the charm to be re-built each time the tests are run, consider using [charmcraftcache](https://github.com/canonical/charmcraftcache) (e.g. `ccc pack`) before the `pytest` command (e.g. in spread.yaml). If you have multiple charms, `ccc pack` needs to be called once for each charm | ||
|
||
Example: https://github.com/canonical/mysql-router-k8s-operator/pull/379 | ||
|
||
### python/pytest_plugins/pytest_operator_groups | ||
Use separate python files (modules) for each test group, or configure different spread (`charmcraft test`) tasks for each group (e.g. using pytest markers) | ||
|
||
### python/pytest_plugins/allure_pytest_collection_report | ||
Use https://github.com/canonical/allure-pytest-default-results instead | ||
|
||
Example: https://github.com/canonical/mysql-router-k8s-operator/pull/379 | ||
|
||
### python/pytest_plugins/github_secrets | ||
Use normal GitHub Actions syntax (https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#using-secrets-in-a-workflow) to pass secrets as environment variables where `charmcraft test` is called | ||
|
||
### python/pytest_plugins/microceph | ||
Set up microceph using spread (`charmcraft test`) or create a pytest fixture to set up microceph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
> [!WARNING] | ||
> `allure-pytest-collection-report` is **deprecated**. Migration instructions: [integration_test_charm_deprecation_notice.md](../../../.github/workflows/integration_test_charm_deprecation_notice.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
> [!WARNING] | ||
> `pytest-github-secrets` is **deprecated**. Migration instructions: [integration_test_charm_deprecation_notice.md](../../../.github/workflows/integration_test_charm_deprecation_notice.md) | ||
Access GitHub secrets from integration tests executed by [integration_test_charm.yaml](../../../.github/workflows/integration_test_charm.yaml) | ||
|
||
Usage: [integration_test_charm.md](../../../.github/workflows/integration_test_charm.md) | ||
|
||
Since reusable GitHub workflows do not support arbitrary secret inputs, all secrets must be encoded into a single string and passed as one secret. This plugin provides a pytest fixture that decodes the string. | ||
Since reusable GitHub workflows do not support arbitrary secret inputs, all secrets must be encoded into a single string and passed as one secret. This plugin provides a pytest fixture that decodes the string. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
> [!WARNING] | ||
> `pytest-microceph` is **deprecated**. Migration instructions: [integration_test_charm_deprecation_notice.md](../../../.github/workflows/integration_test_charm_deprecation_notice.md) | ||
Set up [microceph](https://github.com/canonical/microceph) for S3 backup integration tests executed by [integration_test_charm.yaml](../../../.github/workflows/integration_test_charm.yaml) | ||
|
||
Usage: [integration_test_charm.md](../../../.github/workflows/integration_test_charm.md) | ||
Usage: [integration_test_charm.md](../../../.github/workflows/integration_test_charm.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
> [!WARNING] | ||
> `pytest-operator-cache` is **deprecated**. Migration instructions: [deprecation_notice.md](deprecation_notice.md) | ||
> `pytest-operator-cache` is **deprecated**. Migration instructions: [integration_test_charm_deprecation_notice.md](../../../.github/workflows/integration_test_charm_deprecation_notice.md) | ||
[pytest-operator](https://github.com/charmed-kubernetes/pytest-operator) plugin that overrides `ops_test.build_charm()` to return cached *.charm file instead of building new *.charm file. | ||
|
||
Usage: [integration_test_charm.md](../../../.github/workflows/integration_test_charm.md) | ||
Usage: [integration_test_charm.md](../../../.github/workflows/integration_test_charm.md) |
14 changes: 0 additions & 14 deletions
14
python/pytest_plugins/pytest_operator_cache/deprecation_notice.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
> [!WARNING] | ||
> `pytest-operator-groups` is **deprecated**. Migration instructions: [integration_test_charm_deprecation_notice.md](../../../.github/workflows/integration_test_charm_deprecation_notice.md) | ||
Run integration tests on parallel GitHub runners | ||
|
||
Usage: [integration_test_charm.md](../../../.github/workflows/integration_test_charm.md) | ||
|
||
By default, [pytest-operator](https://github.com/charmed-kubernetes/pytest-operator) runs each test file (Python module) in a separate Juju model. Usually, on GitHub, each integration test file is run in parallel (on separate runners). | ||
|
||
This plugin allows further parallelization—an individual test file can be split into multiple groups. Each group can run on a separate GitHub runner. | ||
This plugin allows further parallelization—an individual test file can be split into multiple groups. Each group can run on a separate GitHub runner. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters