-
Notifications
You must be signed in to change notification settings - Fork 193
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
Simplify integration test workflow fixes #1914 #2354
Merged
+92
−83
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
23df915
Simplify integration test workflow fixes #1914
jaredlockhart 087cedc
Separate kill into two commands for the full stack with normandy/dc
jaredlockhart 188993f
Suppress errors from failing to remove volumes
jaredlockhart ee4874d
Try again to suppress volume rm errors
jaredlockhart ae113ad
Integration tests need a bugzilla host to pass
jaredlockhart 72dd270
Fixed vnc up detached command
jaredlockhart f61731c
Merge branch 'master' into 1914
jaredlockhart a26d5d3
Restore and skip failing test
jaredlockhart a89f2e7
Merge branch 'master' into 1914
jaredlockhart 89444f0
Update README
jaredlockhart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,8 @@ WAIT_FOR_DB = /app/bin/wait-for-it.sh db:5432 -- | |
|
||
COMPOSE = docker-compose -f docker-compose.yml | ||
COMPOSE_TEST = docker-compose -f docker-compose-test.yml | ||
COMPOSE_INTEGRATION = docker-compose -f docker-compose.yml -f docker-compose.integration-test.yml | ||
COMPOSE_FULL = docker-compose -f docker-compose.yml -f docker-compose-full.yml | ||
|
||
PYTHON_TEST = pytest -vvvv --cov --cov-report term-missing --show-capture=no | ||
PYTHON_TEST_FAST = python manage.py test -v 3 --parallel | ||
|
@@ -70,21 +72,26 @@ checkfast: test_build | |
compose_build: build ssl | ||
$(COMPOSE) build | ||
|
||
compose_kill: | ||
compose_stop: | ||
$(COMPOSE) kill | ||
$(COMPOSE_INTEGRATION) kill | ||
|
||
compose_rm: | ||
$(COMPOSE) rm -f | ||
$(COMPOSE) rm -f -v | ||
$(COMPOSE_INTEGRATION) rm -f -v | ||
|
||
volumes_rm: | ||
docker volume ls -q | xargs docker volume rm | ||
docker volume ls -q | xargs docker volume rm -f | echo | ||
|
||
kill: compose_kill compose_rm volumes_rm | ||
kill: compose_stop compose_rm volumes_rm | ||
echo "All containers removed!" | ||
|
||
up: compose_kill compose_build | ||
up: compose_stop compose_build | ||
$(COMPOSE) up | ||
|
||
up_detached: compose_stop compose_build | ||
$(COMPOSE) up -d | ||
|
||
generate_docs: compose_build | ||
$(COMPOSE) run app sh -c "$(GENERATE_DOCS)" | ||
|
||
|
@@ -128,43 +135,32 @@ bash: compose_build | |
|
||
refresh: kill migrate load_locales_countries load_dummy_experiments | ||
|
||
COMPOSE_FULL = docker-compose -f docker-compose.yml -f docker-compose-full.yml | ||
|
||
# experimenter + delivery console + normandy stack | ||
compose_build_all: build ssl | ||
$(COMPOSE_FULL) build | ||
|
||
up_all: compose_build_all | ||
$(COMPOSE_FULL) up | ||
|
||
kill_all: kill | ||
$(COMPOSE_FULL) kill | ||
$(COMPOSE_FULL) -v rm | ||
|
||
normandy_shell: compose_build_all | ||
$(COMPOSE_FULL) run normandy ./manage.py shell | ||
|
||
COMPOSE_INTEGRATION = docker-compose -p experimenter_integration -f docker-compose.yml -f docker-compose.integration-test.yml | ||
|
||
# integration tests | ||
integration_kill: | ||
$(COMPOSE_INTEGRATION) kill | ||
$(COMPOSE_INTEGRATION) rm -f | ||
|
||
integration_build: integration_kill ssl build | ||
integration_build: compose_build | ||
$(COMPOSE_INTEGRATION) build | ||
$(COMPOSE_INTEGRATION) run app sh -c "$(WAIT_FOR_DB) python manage.py migrate;python manage.py load-countries;python manage.py loaddata ./fixtures/locales.json;python manage.py createsuperuser --username admin --email [email protected] --noinput" | ||
|
||
integration_shell: integration_build | ||
$(COMPOSE_INTEGRATION) run firefox bash | ||
|
||
integration_up_shell: | ||
$(COMPOSE_INTEGRATION) run firefox bash | ||
|
||
integration_up_detached: integration_build | ||
$(COMPOSE_INTEGRATION) up -d | ||
|
||
integration_up: integration_build | ||
$(COMPOSE_INTEGRATION) up | ||
integration_vnc_up: integration_build | ||
$(COMPOSE_INTEGRATION) up vnc | ||
|
||
integration_test_run: integration_build | ||
$(COMPOSE_INTEGRATION) run firefox tox -c tests/integration | ||
integration_vnc_up_detached: integration_build | ||
$(COMPOSE_INTEGRATION) up -d vnc | ||
|
||
integration_test: compose_kill integration_test_run integration_kill | ||
echo "Firefox tests complete!" | ||
integration_test: integration_build | ||
$(COMPOSE_INTEGRATION) run firefox tox -c tests/integration |
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
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,5 @@ | ||
import os | ||
|
||
import pytest | ||
import requests | ||
from requests.packages.urllib3.util.retry import Retry | ||
|
@@ -6,6 +8,11 @@ | |
from pages.home import Home | ||
|
||
|
||
@pytest.fixture | ||
def ds_issue_host(): | ||
return os.environ["DS_ISSUE_HOST"] | ||
|
||
|
||
@pytest.fixture | ||
def capabilities(capabilities): | ||
capabilities["acceptInsecureCerts"] = True | ||
|
@@ -15,7 +22,7 @@ def capabilities(capabilities): | |
@pytest.fixture | ||
def firefox_options(firefox_options): | ||
"""Set Firefox Options.""" | ||
firefox_options.headless = True | ||
firefox_options.headless = not bool(os.environ.get("DISABLE_HEADLESS")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can get rid of this line and just use the env variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't get it to work quickly so I filed it as a followup: |
||
firefox_options.log.level = "trace" | ||
return firefox_options | ||
|
||
|
@@ -32,13 +39,13 @@ def _verify_url(request, base_url): | |
|
||
|
||
@pytest.fixture | ||
def fill_overview(selenium, base_url): | ||
def fill_overview(selenium, base_url, ds_issue_host): | ||
selenium.get(base_url) | ||
home = Home(selenium, base_url).wait_for_page_to_load() | ||
experiment = home.create_experiment() | ||
experiment.name = "This is a test" | ||
experiment.short_description = "Testing in here" | ||
experiment.public_name = "Public Name" | ||
experiment.public_description = "Public Description" | ||
experiment.bugzilla_url = "https://jira.mozilla.com/browse/DS-123" | ||
experiment.ds_issue_url = f"{ds_issue_host}DS-12345" | ||
return experiment |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of having 2 services, we could just use the
MOZ_HEADLESS
env variable. If it is set then the tests would not be viewable through the vnc server.