-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into rough-in-pinpoint
- Loading branch information
Showing
9 changed files
with
80 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Smoke Tests | ||
|
||
This repository contains a set of smoke tests for our application. Smoke testing, also known as "Build Verification Testing", is a type of software testing that comprises of a non-exhaustive set of tests that aim at ensuring that the most important functions work. The phrase 'smoke testing' comes from the hardware testing, where you plug in a new piece of hardware and turn it on for the first time. If it starts smoking, you know you have a problem. | ||
|
||
## Getting Started | ||
|
||
These smoke tests are designed to run in the api devcontainer. | ||
|
||
in the root of the repo create `.env` files for the environments you with to smoke test, for example `.env_smoke_local`, `.env_smoke_staging`, and `.env_smoke_prod`. For required values see the [.env.example](.env.example) file). | ||
|
||
## Running the tests | ||
|
||
in the devcontainer run the aliases `smoke-local`, `smoke-staging`, or `smoke-prod` to run the tests. | ||
|
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
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,19 +1,28 @@ | ||
import argparse | ||
|
||
from smoke.common import Attachment_type, Config, Notification_type # type: ignore | ||
from smoke.test_admin_csv import test_admin_csv # type: ignore | ||
from smoke.test_admin_one_off import test_admin_one_off # type: ignore | ||
from smoke.test_api_bulk import test_api_bulk # type: ignore | ||
from smoke.test_api_one_off import test_api_one_off # type: ignore | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-l", "--local", default=False, action='store_true', help="run locally, do not check for delivery success (default false)") | ||
parser.add_argument("--nofiles", default=False, action='store_true', help="do not send files (default false)") | ||
args = parser.parse_args() | ||
|
||
print("API Smoke test\n") | ||
for key in ["API_HOST_NAME", "SERVICE_ID", "EMAIL_TEMPLATE_ID", "SMS_TEMPLATE_ID", "EMAIL_TO", "SMS_TO"]: | ||
print(f"{key:>17}: {Config.__dict__[key]}") | ||
print("") | ||
|
||
for notification_type in [Notification_type.EMAIL, Notification_type.SMS]: | ||
test_admin_one_off(notification_type) | ||
test_admin_csv(notification_type) | ||
test_api_one_off(notification_type) | ||
test_api_bulk(notification_type) | ||
test_api_one_off(Notification_type.EMAIL, Attachment_type.ATTACHED) | ||
test_api_one_off(Notification_type.EMAIL, Attachment_type.LINK) | ||
test_admin_one_off(notification_type, local=args.local) | ||
test_admin_csv(notification_type, local=args.local) | ||
test_api_one_off(notification_type, local=args.local) | ||
test_api_bulk(notification_type, local=args.local) | ||
|
||
if not args.nofiles: | ||
test_api_one_off(Notification_type.EMAIL, attachment_type=Attachment_type.ATTACHED, local=args.local) | ||
test_api_one_off(Notification_type.EMAIL, attachment_type=Attachment_type.LINK, local=args.local) |