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

Make it easier to run and debug tests locally #169

Closed
peterbom opened this issue Apr 21, 2022 · 0 comments · Fixed by #170
Closed

Make it easier to run and debug tests locally #169

peterbom opened this issue Apr 21, 2022 · 0 comments · Fixed by #170
Assignees
Labels
enhancement 🏎 New feature or request

Comments

@peterbom
Copy link
Contributor

peterbom commented Apr 21, 2022

Motivation

  1. Tests run locally do not behave the same as the CI build, unless some quite elaborate manual steps are followed to exactly match the scripts defined in the CI workflow yaml.
  2. Adding further test setup requires extra scripts in the CI workflow yaml, which is already quite extensive.

Proposal
We can define the test setup in the Periscope go code itself, using the following steps:

  1. Use the golang docker client to create an aks-periscope-test-tools docker image that contains the setup tools (kubectl, kind, helm, etc.).
  2. Use the docker client to run kind in a container (using the above image) to create the cluster.
  3. Use the same approach to deploy resources (e.g., helm charts) to the cluster.

We could then:

  1. Remove the setup scripts from the CI workflow, leaving the go test ./... command.
  2. Run go test locally and expect the same behaviour.
  3. Add a vscode launch.json config for debugging tests locally (again behaving exactly the same as the CI workflow).

Benefits
This will allow:

@peterbom peterbom added the enhancement 🏎 New feature or request label Apr 21, 2022
@peterbom peterbom self-assigned this Apr 21, 2022
@peterbom peterbom linked a pull request May 1, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🏎 New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant