mirror of
https://github.com/ansible/awx.git
synced 2026-03-23 20:05:03 -02:30
* Create a new pytest folder for live system testing with normal services (#15688) * PoC for running dev env tests * Replace in github actions * Move folder to better location * Further streamlining of new test folders * Consolidate fixture, add writeup docs * Use star import * Push the wait-for-job to the conftest Fix misused project cache identifier (#15690) Fix project cache identifiers for new updates Finish test and discover viable solution Add comment on related task code AAP-37989 Tests for exclude list with multiple jobs (#15722) * Tests for exclude list with multiple jobs Create test for using manual & file projects (#15754) * Create test for using a manual project * Chang default project factory to git, remove project files monkeypatch * skip update of factory project * Initial file scaffolding for feature * Fill in galaxy and names * Add README, describe project folders and dependencies Add ee cleanup tests * Adds cleanup tests to the live test. Fix rsyslog permission error in github ubuntu tests from apparmor (#15717) * Add test to detect rsyslog config problems * Get dmesg output * Disable apparmor for rsyslogd Make awx/main/tests/live dramatically faster (#15780) * Make awx/main/tests/live dramatically faster * Add new setting to exclude list * Fix rebase issues * Did not want to backport this
43 lines
1.7 KiB
Markdown
43 lines
1.7 KiB
Markdown
## Test Environments
|
|
|
|
Several of the subfolders of `awx/main/tests/` indicate a different required _environment_
|
|
where you can run the tests. Those folders are:
|
|
|
|
- `functional/` - requires a test database and no other services running
|
|
- `live/` - must run in `tools_awx_1` container launched by `make docker-compose`
|
|
- `unit/` - does not require a test database or any active services
|
|
|
|
### Functional and unit test environment
|
|
|
|
The functional and unit tests have an invocation in `make test`,
|
|
and this attaches several other things like schema that piggybacks on requests.
|
|
These tests are ran from the root AWX folder.
|
|
|
|
#### Functional tests
|
|
|
|
Only tests in the `functional/` folder should use the `@pytest.mark.django_db` decorator.
|
|
This is the only difference between the functional and unit folders,
|
|
the test environment is otherwise the same for both.
|
|
|
|
Functional tests use a sqlite3 database, so the postgres service is not necessary.
|
|
|
|
### Live tests
|
|
|
|
The live tests have an invocation in `make live_test` which will change
|
|
directory before running, which is required to pick up a different pytest
|
|
configuration.
|
|
|
|
This will use the postges container from `make docker-compose` for the database,
|
|
and will disable the pytest-django features of running with a test database
|
|
and running tests in transactions.
|
|
This means that any changes done in the course of the test could potentially
|
|
be seen in your browser via the API or UI, and anything the test fails
|
|
to clean up will remain in the database.
|
|
|
|
### Folders that should not contain tests
|
|
|
|
- `data/` - just files other tests use
|
|
- `docs/` - utilities for schema generation
|
|
- `factories/` - general utilities
|
|
- `manual/` - python files to be ran directly
|