Skip to content

Propose an approach to automate platform testing #9

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Allow creation of collapsable sections in Markdown
# (See https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-collapsed-sections)
MD033:
allowed_elements:
- summary
- details
85 changes: 85 additions & 0 deletions docs/decisions/0002-automate-testing-of-platform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Approach for Automated Testing of the Platform

* Status: proposed
* Deciders: [list everyone involved in the decision] <!-- optional -->
* Date: [YYYY-MM-DD when the decision was last updated] <!-- optional -->

Technical Story: Spike: Automated testing for platform [[#6](https://github.com/navapbc/platform/issues/6)

## Context and Problem Statement

Testing the platform currently requires multiple time-consuming steps, involving
creating a new repo, copying over template code, creating infrastructure from
template code, and verifying that CI and CD works. Furthermore, splitting up the
platform into separate template-infra and template-application-* repositories
increases the importance of testing the pieces together in an integrated
fashion. In order to sustainably maintain development of the platform, we need a
way to test the platform in an automated fashion.

## Proposal

### Overview

* Have a CI GitHub Action in `platform` repo that runs regularly (e.g. weekly or daily)
* The `platform` CI will:
1. Create a test repo `platform-test-[WORKFLOW_RUN_ID]`
2. Install the `template-infra` into the test repo
3. Install `template-application-nextjs` into the test repo
4. Run through the steps to set up the terraform backend
5. Spin up the application's infrastructure
6. Push up a test commit
7. Watch the GitHub action workflow runs for CI and CD
8. Check that CI and CD both complete successfully
9. Hit the deployed application's health check endpoint
10. Destroy the infrastructure
11. Delete the test repo

### Details

TBD

## Decision Outcome

TBD

### Positive Consequences

TBD

### Negative Consequences

TBD

## Pros and Cons of the Options <!-- optional -->

### [option 1]

[example | description | pointer to more information | …] <!-- optional -->

* Good, because [argument a]
* Good, because [argument b]
* Bad, because [argument c]
* … <!-- numbers of pros and cons can vary -->

### [option 2]

[example | description | pointer to more information | …] <!-- optional -->

* Good, because [argument a]
* Good, because [argument b]
* Bad, because [argument c]
* … <!-- numbers of pros and cons can vary -->

### [option 3]

[example | description | pointer to more information | …] <!-- optional -->

* Good, because [argument a]
* Good, because [argument b]
* Bad, because [argument c]
* … <!-- numbers of pros and cons can vary -->

## Links <!-- optional -->

* [Link type] [Link to ADR] <!-- example: Refined by [ADR-0005](0005-example.md) -->
* … <!-- numbers of links can vary -->