GithubHelp home page GithubHelp logo

pay-smoke-tests's Introduction

pay-smoke-tests

GOV.UK Pay's AWS CloudWatch Synthetics Canaries

This repository contains the code used by GOV.UK Pay to run smoke tests against the Pay platform.

They are triggered on a schedule and post application deploy on Concourse.

They are managed via Terraform in which is stored in pay-infra.

The scripts which run the Canaries post application deploy can be found in pay-ci.

Naming

The AWS Canary resources have a 21-character name limit. The full test name is included in the resource tags, however here's a quick reference guide:

Scenario Environment Canary name
make-card-payment-sandbox-without-3ds test card_sandbox_test
make-recurring-card-payment-sandbox test rec_card_sandbox_test
make-card-payment-stripe-with-3ds2 test card_stripe_3ds_test
make-card-payment-stripe-without-3ds test card_stripe_test
make-card-payment-worldpay-with-3ds2 test card_wpay_3ds2_test
make-card-payment-worldpay-with-3ds2-exemption test card_wpay_3ds2ex_test
make-card-payment-worldpay-without-3ds test card_wpay_test
make-recurring-card-payment-worldpay test reccard_worldpay_test
make-recurring-card-payment-stripe test rec_card_stripe_test
notifications-sandbox test notifications_test
cancel-card-payment-sandbox-without-3ds test cancel_sandbox_test
use-payment-link-for-sandbox test pymntlnk_sandbox_test
make-card-payment-sandbox-without-3ds staging card_sandbox_stag
make-recurring-card-payment-sandbox staging rec_card_sandbox_stag
make-card-payment-stripe-with-3ds2 staging card_stripe_3ds_stag
make-card-payment-stripe-without-3ds staging card_stripe_stag
make-card-payment-worldpay-with-3ds2 staging card_wpay_3ds2_stag
make-card-payment-worldpay-with-3ds2-exemption staging card_wpay_3ds2ex_stag
make-card-payment-worldpay-without-3ds staging card_wpay_stag
make-recurring-card-payment-worldpay staging reccard_worldpay_test
make-recurring-card-payment-stripe staging rec_card_stripe_stag
notifications-sandbox staging notifications_stag
cancel-card-payment-sandbox-without-3ds staging cancel_sandbox_stag
use-payment-link-for-sandbox staging pymntlnk_sandbox_stag
make-card-payment-sandbox-without-3ds production card_sandbox_prod
make-recurring-card-payment-sandbox production rec_card_sandbox_prod
make-card-payment-stripe-with-3ds2 production card_stripe_3ds_prod
make-card-payment-stripe-without-3ds production card_stripe_prod
make-card-payment-worldpay-with-3ds2 production card_wpay_3ds2_prod
make-card-payment-worldpay-with-3ds2-exemption production card_wpay_3ds2ex_prod
make-card-payment-worldpay-without-3ds production card_wpay_prod
make-recurring-card-payment-worldpay production reccard_worldpay_test
make-recurring-card-payment-stripe production rec_card_stripe_prod
notifications-sandbox production notifications_prod
cancel-card-payment-sandbox-without-3ds production cancel_sandbox_prod
use-payment-link-for-sandbox production pymntlnk_sandbox_prod

Structure

Stubs

AWS uses two libraries Synthetics and SyntheticsLogger, which appear to only be available inside of the lambda runtime, because of this when running tests locally we need to stub out both of these libraries using Puppeteer. The stubs for these exist in the stubs directory in the root of the repository.

Test Harness

To run the tests locally use the run-local/index.js script. Provide the name of the test you want to run with the --test flag. It will print out the valid test names if none is provided or an invalid name is given. Provide the environment to run the tests for with the '--env' flag.

To run the tests in a headless mode use the --headless flag.

Example:

aws-vault exec deploy -- node run-local/index.js --test make-card-payment-sandbox-without-3ds --env test --headless

Tests

Each smoke test should have its own folder which should be placed in the root of the repository.

Building packaged zip files

In the event you need to build packaged zip files of the tests, for example when adding a new smoke test, run

npm run build 

The zip files will be located in the dist/zip directory.

Releases

When a PR is merged, a Github Action will build a package and create a release.

The smoke test Canaries can then be updated by a developer using the Concourse deploy-smoke-tests pipeline.

Licence

MIT License

Responsible Disclosure

GOV.UK Pay aims to stay secure for everyone. If you are a security researcher and have discovered a security vulnerability in this code, we appreciate your help in disclosing it to us in a responsible manner. We will give appropriate credit to those reporting confirmed issues. Please e-mail [email protected] with details of any issue you find, we aim to reply quickly.

pay-smoke-tests's People

Contributors

adityapahuja avatar danworth avatar dependabot[bot] avatar dj-maisy avatar heathd avatar iqbalgds avatar jfharden avatar katstevens avatar kbottla avatar nlsteers avatar oswaldquek avatar rkotyank avatar sandorarpa avatar stephencdaly avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.