diff --git a/.dockerignore b/.dockerignore index 0f6e67d41..8f5c138d0 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,4 +4,4 @@ frontend/node_modules/ # Ephemeral data for local development. These will get volume mounted. archive/ myanalysis/ -systemtests/data/ +smoketests/data/ diff --git a/.gitignore b/.gitignore index f8abb82cd..fece7a2af 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,5 @@ version.json yarn-debug.log* yarn-error.log* -# Ephemeral systemtest data -systemtests/data/ +# Ephemeral smoke test data +smoketests/data/ diff --git a/bin/run_lint.sh b/bin/run_lint.sh index ee7bff7ad..b01e72c5f 100755 --- a/bin/run_lint.sh +++ b/bin/run_lint.sh @@ -12,7 +12,7 @@ set -e -FILES="bin tecken systemtests" +FILES="bin tecken smoketests" PYTHON_VERSION=$(python --version) diff --git a/docs/dev.rst b/docs/dev.rst index 7eb2e5c0e..e6b2387a2 100644 --- a/docs/dev.rst +++ b/docs/dev.rst @@ -634,19 +634,19 @@ this code and it has to be tested manually. You can do something like this: 11. click on "Sign out" -System tests ------------- +Smoke tests +----------- -System tests are located in the repository in ``systemtests/``. See the +Smoke tests are located in the repository in ``smoketests/``. See the ``README.rst`` there for usage. -System tests can be run against any running environment: +Smoke tests can be run against any running environment: * local: local dev environment * stage: the stage server environment * prod: the prod server environment--will not run destructive tests -System tests can help verify that upload API and download API work. They +Smoke tests can help verify that upload API and download API work. They periodically need to be updated as symbols files expire out of the systems. diff --git a/docs/overview.rst b/docs/overview.rst index d5607338e..38b75d737 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -52,12 +52,11 @@ Here's a bunch of top-level directories and what's in them:: docs/ -- documentation favicons/ -- favicons used by Symbols webapp frontend/ -- Symbols webapp JavaScript frontend - schemas/ -- API schemas tecken/ -- Symbols service unit tests and code These directories have test stuff in them:: - systemtests/ -- systemtests for Symbols Server + smoketests/ -- smoke tests for Symbols Server .. Note:: diff --git a/systemtests/README.rst b/smoketests/README.rst similarity index 66% rename from systemtests/README.rst rename to smoketests/README.rst index 95e47a64d..7d1a94119 100644 --- a/systemtests/README.rst +++ b/smoketests/README.rst @@ -1,6 +1,6 @@ -================= -Systemtest README -================= +================== +Smoke tests README +================== These test Tecken stage and prod environments. @@ -14,30 +14,30 @@ Contents of this directory:: Setting up tests ================ -Before running the systemtests, you need to `build a local dev environment +Before running the smoke tests, you need to `build a local dev environment `__. Then set up the tests this way:: $ make shell - root@e62fb7ae586f:/app# cd systemtests - root@e62fb7ae586f:/app/systemtests# ./setup_tests.py + root@e62fb7ae586f:/app# cd smoketests + root@e62fb7ae586f:/app/smoketests# ./setup_tests.py That creates files in directories under ``data/``. -You only need to set up the tests once to run the system tests against all +You only need to set up the tests once to run the smoke tests against all environments. Running tests ============= -The system tests are run using the ``test_env.py`` Python script. You can get +The smoke tests are run using the ``test_env.py`` Python script. You can get help about the command-line invocation of that script using:: $ make shell - root@e62fb7ae586f:/app# cd systemtests - root@e62fb7ae586f:/app/systemtests# ./test_env.py --help + root@e62fb7ae586f:/app# cd smoketests + root@e62fb7ae586f:/app/smoketests# ./test_env.py --help The help includes a list of available environments. @@ -49,13 +49,13 @@ variable names in the help output, e.g. ``STAGE_AUTH_TOKEN`` and For destructive tests run in local and stage, you need separate auth tokens for try uploads with "Upload Try Symbols Files" permissions. See Bug 1759740. -To run the systemtests, do:: +To run the smoke tests, do:: - root@e62fb7ae586f:/app/systemtests# ./test_env.py + root@e62fb7ae586f:/app/smoketests# ./test_env.py -Rules of systemtest -=================== +Rules of smoke tests +==================== 1. Don't run destructive tests against the prod server environment. diff --git a/systemtests/__init__.py b/smoketests/__init__.py similarity index 100% rename from systemtests/__init__.py rename to smoketests/__init__.py diff --git a/systemtests/bin/__init__.py b/smoketests/bin/__init__.py similarity index 100% rename from systemtests/bin/__init__.py rename to smoketests/bin/__init__.py diff --git a/systemtests/bin/download_sym_files.py b/smoketests/bin/download_sym_files.py similarity index 99% rename from systemtests/bin/download_sym_files.py rename to smoketests/bin/download_sym_files.py index 7e925ad05..5bddb4702 100755 --- a/systemtests/bin/download_sym_files.py +++ b/smoketests/bin/download_sym_files.py @@ -157,7 +157,7 @@ def download_sym_files(base_url, test_headers, csv_file): click.echo(click.style(f"Working on {url} ...", fg="yellow")) headers = { - "User-Agent": "tecken-systemtests", + "User-Agent": "tecken-smoketests", # We know storage backends will honor "Accept-Encoding": "gzip", # so we test the unusual case only to ensure the response is # still gzipped. diff --git a/systemtests/bin/list_firefox_symbols_zips.py b/smoketests/bin/list_firefox_symbols_zips.py similarity index 98% rename from systemtests/bin/list_firefox_symbols_zips.py rename to smoketests/bin/list_firefox_symbols_zips.py index 7c5deaead..d8dab2d8a 100755 --- a/systemtests/bin/list_firefox_symbols_zips.py +++ b/smoketests/bin/list_firefox_symbols_zips.py @@ -21,7 +21,7 @@ QUEUE = "https://firefox-ci-tc.services.mozilla.com/api/queue/v1/" NAMESPACE = "gecko.v2.mozilla-central.revision.REV.firefox" -HTTP_HEADERS = {"User-Agent": "tecken-systemtests"} +HTTP_HEADERS = {"User-Agent": "tecken-smoketests"} def index_namespaces(namespace, limit=1000): diff --git a/systemtests/bin/setup_download_tests.py b/smoketests/bin/setup_download_tests.py similarity index 98% rename from systemtests/bin/setup_download_tests.py rename to smoketests/bin/setup_download_tests.py index 3e6add659..fd5ed9302 100755 --- a/systemtests/bin/setup_download_tests.py +++ b/smoketests/bin/setup_download_tests.py @@ -20,7 +20,7 @@ import markus from markus.backends import BackendBase -from systemtestslib.utils import build_zip_file, download_sym_file, get_sym_files +from smoketestslib.utils import build_zip_file, download_sym_file, get_sym_files # Number of seconds to wait for a response from server @@ -219,7 +219,7 @@ def setup_download_tests(start_page, auth_token, csv_output_path, zip_output_dir """ Generates a list of sym files, writes them to a CSV, and downloads them to two separate zip folders: one for try symbols files, and one for - regular symbols files. This is used for the download system tests. + regular symbols files. This is used for the download smoke tests. Runtime is dependent on what files have been uploaded recently. @@ -258,7 +258,7 @@ def setup_download_tests(start_page, auth_token, csv_output_path, zip_output_dir # Figure out the ZIP file names and final path # Try files go into a separate zip from regular files, so they # can be uploaded to the correct bucket later as part of the - # upload system tests. + # upload smoke tests. zip_filename_try = datetime.datetime.now().strftime( "symbols_%Y%m%d_%H%M%S__try.zip" ) diff --git a/systemtests/bin/setup_upload_tests.py b/smoketests/bin/setup_upload_tests.py similarity index 98% rename from systemtests/bin/setup_upload_tests.py rename to smoketests/bin/setup_upload_tests.py index 4eba793ed..92f702f2d 100755 --- a/systemtests/bin/setup_upload_tests.py +++ b/smoketests/bin/setup_upload_tests.py @@ -18,7 +18,7 @@ import markus from markus.backends import BackendBase -from systemtestslib.utils import build_zip_file, download_sym_file, get_sym_files +from smoketestslib.utils import build_zip_file, download_sym_file, get_sym_files # Number of seconds to wait for a response from server diff --git a/systemtests/bin/upload_symbols.py b/smoketests/bin/upload_symbols.py similarity index 99% rename from systemtests/bin/upload_symbols.py rename to smoketests/bin/upload_symbols.py index 251f56f60..776378f11 100755 --- a/systemtests/bin/upload_symbols.py +++ b/smoketests/bin/upload_symbols.py @@ -69,7 +69,7 @@ def upload_symbols(ctx, expect_code, auth_token, base_url, symbolsfile): ) api_url = urljoin(base_url, "/upload/") - headers = {"auth-token": auth_token, "User-Agent": "tecken-systemtests"} + headers = {"auth-token": auth_token, "User-Agent": "tecken-smoketests"} basename = os.path.basename(symbolsfile) # This is an upload and it's success is partially dependent on the diff --git a/systemtests/bin/upload_symbols_by_download.py b/smoketests/bin/upload_symbols_by_download.py similarity index 99% rename from systemtests/bin/upload_symbols_by_download.py rename to smoketests/bin/upload_symbols_by_download.py index 5171593dc..f34905b25 100755 --- a/systemtests/bin/upload_symbols_by_download.py +++ b/smoketests/bin/upload_symbols_by_download.py @@ -62,7 +62,7 @@ def upload_symbols_by_download(ctx, base_url, auth_token, url, expect_code): """Upload SYM file to a host using a download url.""" api_url = urljoin(base_url, "/upload/") - headers = {"auth-token": auth_token, "User-Agent": "tecken-systemtests"} + headers = {"auth-token": auth_token, "User-Agent": "tecken-smoketests"} # It's possible this can fail, so we put it in a retry loop. for i in range(MAX_ATTEMPTS): diff --git a/systemtests/setup_tests.py b/smoketests/setup_tests.py similarity index 89% rename from systemtests/setup_tests.py rename to smoketests/setup_tests.py index 855321307..3b582478e 100755 --- a/systemtests/setup_tests.py +++ b/smoketests/setup_tests.py @@ -8,8 +8,8 @@ import click -from systemtests.bin.setup_download_tests import setup_download_tests -from systemtests.bin.setup_upload_tests import setup_upload_tests +from smoketests.bin.setup_download_tests import setup_download_tests +from smoketests.bin.setup_upload_tests import setup_upload_tests # Usage: ./setup-tests.py # This setup is only for non-prod envs (local and stage), as it uploads @@ -26,7 +26,7 @@ def setup_tests(ctx): # Create the zip output directory if it doesn't exist os.makedirs(ZIPS_DIR) - click.echo("Generating systemtest data files ...") + click.echo("Generating smoketest data files ...") zips_count = len( [name for name in os.listdir(ZIPS_DIR) if os.path.isfile(f"{ZIPS_DIR}/{name}")] ) diff --git a/systemtests/systemtestslib/__init__.py b/smoketests/smoketestslib/__init__.py similarity index 100% rename from systemtests/systemtestslib/__init__.py rename to smoketests/smoketestslib/__init__.py diff --git a/systemtests/systemtestslib/utils.py b/smoketests/smoketestslib/utils.py similarity index 96% rename from systemtests/systemtestslib/utils.py rename to smoketests/smoketestslib/utils.py index 791f40ae7..baee68704 100644 --- a/systemtests/systemtestslib/utils.py +++ b/smoketests/smoketestslib/utils.py @@ -2,7 +2,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. -# Utilities used to setup upload and download system tests. +# Utilities used to setup upload and download smoke tests. import os from urllib.parse import urljoin @@ -25,7 +25,7 @@ def get_sym_files(baseurl, auth_token, params): """ url = urljoin(baseurl.rstrip("/"), "/api/uploads/files") - headers = {"auth-token": auth_token, "User-Agent": "tecken-systemtests"} + headers = {"auth-token": auth_token, "User-Agent": "tecken-smoketests"} params = params or {} sym_files = [] @@ -89,7 +89,7 @@ def build_zip_file(zip_filename, sym_dir): def download_sym_file(url, sym_file_path): """Download SYM file at url into sym_file_path.""" - headers = {"User-Agent": "tecken-systemtests"} + headers = {"User-Agent": "tecken-smoketests"} resp = requests.get(url, headers=headers, timeout=CONNECTION_TIMEOUT) resp.raise_for_status() diff --git a/systemtests/test_env.py b/smoketests/test_env.py similarity index 94% rename from systemtests/test_env.py rename to smoketests/test_env.py index 4410ece50..50804cc5f 100755 --- a/systemtests/test_env.py +++ b/smoketests/test_env.py @@ -11,10 +11,10 @@ import click -from systemtests.bin.download_sym_files import download_sym_files -from systemtests.bin.list_firefox_symbols_zips import list_firefox_symbols_zips -from systemtests.bin.upload_symbols import upload_symbols -from systemtests.bin.upload_symbols_by_download import upload_symbols_by_download +from smoketests.bin.download_sym_files import download_sym_files +from smoketests.bin.list_firefox_symbols_zips import list_firefox_symbols_zips +from smoketests.bin.upload_symbols import upload_symbols +from smoketests.bin.upload_symbols_by_download import upload_symbols_by_download ZIP_FILES = list(Path("./data/zip-files").glob("*.zip")) @@ -109,7 +109,7 @@ def auth_token(self, try_storage: bool) -> str: \b Usage: 1. run "make shell" to get a shell in the container -2. then do "cd systemtests" +2. then do "cd smoketests" 3. run "./setup_tests.py" if you are running the tests for the first time. 4. run "./test_env.py [{"|".join(ENVIRONMENTS)}]"