Skip to content
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

Add automated testing #13

Open
carterm opened this issue Jul 8, 2021 · 3 comments
Open

Add automated testing #13

carterm opened this issue Jul 8, 2021 · 3 comments

Comments

@carterm
Copy link
Contributor

carterm commented Jul 8, 2021

intercept fetches and replace

Inputs can be static json
outputs with json schema validation

@chachasikes
Copy link
Contributor

@carterm

What are your current thoughts on automated testing?

  1. Do you have a list of the main business logic of your service that need tests?
  2. What kinds of tests do you think this script needs?
  3. Can you make an outline of the kinds of tests that make sense for your service?
  4. What are some of the risks of adding tests to this system?

@carterm
Copy link
Contributor Author

carterm commented Oct 22, 2021

Some quick wins

  • JSON Schema validation.

    • Build/Deploy time - Validate all saved project JSON files during build to make sure they match their defined "$schema". Could be done with lint.
    • Runtime - Validate input schema from external sources not covered by project schema.
    • Runtime - Validate output schema
  • Dummy (better word needed) environment, complete separate end-to-end test

    • Need Azure instance to run a "automated test" branch that will have a custom endpoints.json. And logic to report a test fail.
    • Need WordPress instance where nothing changes
    • Need target branch where nothing changes
    • Test fails if service makes an actual change commit.

@carterm
Copy link
Contributor Author

carterm commented Oct 22, 2021

Javascript schema validation examples can be found in this project, although using the $schema ref directly would be better than relying on paths.
https://github.com/cagov/Cron/tree/master/common/SQL/CDT_COVID/Daily-stats-v2/schema

@chachasikes chachasikes removed the p0 label Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants