Skip to content

refactor: all unit/e2e tests to Golang#1524

Merged
tommartensen merged 38 commits intomasterfrom
tm/improve-test-performance
Mar 25, 2025
Merged

refactor: all unit/e2e tests to Golang#1524
tommartensen merged 38 commits intomasterfrom
tm/improve-test-performance

Conversation

@tommartensen
Copy link
Copy Markdown
Contributor

@tommartensen tommartensen commented Mar 13, 2025

  • Refactors the remaining BATS tests to Golang and removes the parts of CI that run BATS tests.

Required changes:

  • infractl create --rhacs flag is now always exposed, this is required because os.Args can't be modified to include the flag if we run go test.
  • refactored the current working environment and naming logic for clusters in infractl create. We need to be able to mock the working environment in e2e tests and it was all a bit hard to read
  • infractl flavor list --json now returns the flavor availability as a string, not enum int (ie alpha instead of 0). This improves usability.
  • WorkflowTemplate2Flavor now returns a flavor and a list of validation errors. The behaviour of logging and ignoring validation errors during service startup remains the same, but I implemented unit tests that check the errors. WorkflowTemplates are now removed, because they are unused (except tests - also refactored to just Workflows)
  • Reduced the lifespan and create/delete delays in e2e tests to make them a bit quicker.

Also:

  • experimented with t.Parallel() - that was too unstable for my liking. Can be revisited later.

@tommartensen tommartensen self-assigned this Mar 13, 2025
@rhacs-bot
Copy link
Copy Markdown
Contributor

rhacs-bot commented Mar 13, 2025

A single node development cluster (infra-pr-1524) was allocated in production infra for this PR.

CI will attempt to deploy quay.io/rhacs-eng/infra-server:0.11.0-38-gc6159cf9c3 to it.

🔌 You can connect to this cluster with:

gcloud container clusters get-credentials infra-pr-1524 --zone us-central1-a --project acs-team-temp-dev

🛠️ And pull infractl from the deployed dev infra-server with:

nohup kubectl -n infra port-forward svc/infra-server-service 8443:8443 &
make pull-infractl-from-dev-server

🚲 You can then use the dev infra instance e.g.:

bin/infractl -k -e localhost:8443 whoami

⚠️ Any clusters that you start using your dev infra instance should have a lifespan shorter then the development cluster instance. Otherwise they will not be destroyed when the dev infra instance ceases to exist when the development cluster is deleted. ⚠️

Further Development

☕ If you make changes, you can commit and push and CI will take care of updating the development cluster.

🚀 If you only modify configuration (chart/infra-server/configuration) or templates (chart/infra-server/{static,templates}), you can get a faster update with:

make helm-deploy

Logs

Logs for the development infra depending on your @redhat.com authuser:

Or:

kubectl -n infra logs -l app=infra-server --tail=1 -f

Base automatically changed from tm/infra-janitor to master March 17, 2025 10:07
@tommartensen tommartensen changed the title fix: improve e2e test performance refactor: all unit/e2e tests to Golang Mar 18, 2025
@tommartensen tommartensen marked this pull request as ready for review March 18, 2025 08:04
@tommartensen tommartensen requested a review from a team as a code owner March 18, 2025 08:04
davdhacs added a commit that referenced this pull request Mar 24, 2025
to be removed in #1524
Copy link
Copy Markdown
Contributor

@davdhacs davdhacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1💥!

@tommartensen tommartensen merged commit 4443b05 into master Mar 25, 2025
10 checks passed
@tommartensen tommartensen deleted the tm/improve-test-performance branch March 25, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants