Running integration tests¶
Based on running docker compose stack deployment mode (standalone, community, insights), install requirements, set environment variables and markers on the host:
Install integration_requirements.txt in your virtual env
python3 -m venv gng_int_testing
source gng_int_testing/bin/activate
pip install -r integration_requirements.txt
Standalone¶
export HUB_API_ROOT='http://localhost:5001/api/galaxy/'
export HUB_LOCAL=1
export HUB_USE_MOVE_ENDPOINT="true"
Community¶
export HUB_API_ROOT='http://localhost:5001/api/'
export HUB_LOCAL=1
export HUB_TEST_AUTHENTICATION_BACKEND=community
run tests:
Insights (cloud)¶
export HUB_API_ROOT="http://localhost:8080/api/automation-hub/"
export HUB_AUTH_URL="http://localhost:8080/auth/realms/redhat-external/protocol/openid-connect/token"
export HUB_USE_MOVE_ENDPOINT="true"
export HUB_UPLOAD_SIGNATURES="true"
run tests:
or specify test you would like to run:
Tests that are intended to pass on any deployment mode should be marked with all. By default unmarked tests will receive the all mark. Alldeployment_standalonetests are also expected to pass when running with ldap or keycloak authentication. If a test is meant to test a specific authentication backend, use theldaporkeycloakmarks, and removedeployment_standalone`. List of all marks in conftest.py
Test Data¶
- Test data is defined in galaxy_ng/dev/common/setup_test_data.py and includes namespaces, users, tokens, and groups
- This data is used for all ways the integration tests are run
- Note: this script is also called by default when manual ephemeral environments are spun up, via
ahub.sh
User Profiles¶
- User profiles are defined in galaxy_ng/tests/integration/conftest.py
- Usernames are different than the profile name, check
conftest.pyfor usernames and passwords - Usernames and passwords match the ephemeral enviornment Keycloak SSO, so the same test data is used for
DEPLOYMENT_MODE=standaloneandDEPLOYMENT_MODE=insights
User Profile List¶
basic_useruser with only permissions on a namespace for uploadpartner_engineeruser with permissions to add namespaces, groups, users, and approve content fromstagingrepo intopublishedrepoorg_adminoutside our app in ephemeral environments the Keycloak SSO defines this user as an Organization Admin for a customer account, used with forDEPLOYMENT_MODE=insightsadmina django superuser, to be used sparingly in tests