Skip to content

Conversation

@mridang
Copy link
Collaborator

@mridang mridang commented Jun 23, 2025

Description

This PR swaps our bash-based test harness for a self-documenting Magefile. mage test:default now spins up the namespaced Docker-Compose stack, waits for health checks plus a 30-second buffer, runs the acceptance tests, streams compose logs automatically when debug flags are set, and then tears everything down. A test:cover variant produces profile.cov for Codecov. The change gives us a single, reproducible command that works identically on every developer machine and in CI while eliminating flaky start-up races and manual log collection.

Motivation and Context

It simplifies running the tests locally.

How Has This Been Tested?

By both running the tests locally and also by updating the workflows on GitHub.

Documentation:

None.

Checklist:

None.

Definition of Ready

  • Short description of the feature/issue is added in the pr description
  • PR is linked to the corresponding user story
  • Acceptance criteria are met
  • All open todos and follow ups are defined in a new ticket and justified
  • Deviations from the acceptance criteria and design are agreed with the PO and documented.
  • No debug or dead code
  • My code has no repetitions
  • All non-functional requirements are met
  • The generic lifecycle acceptance test passes for affected resources.
  • Examples are up-to-date and meaningful. The provider version is incremented.
  • Docs are generated.
  • Code is generated where possible.

Copy link
Member

@eliobischof eliobischof left a comment

Choose a reason for hiding this comment

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

In a go repo, Mage is definitely better than Make :-)

Let's update the CONTRIBUTING.md

Comment on lines +76 to +77
fmt.Println("golangci-lint not found – falling back to `go vet`")
return sh.RunV("go", "vet", "./...")
Copy link
Member

Choose a reason for hiding this comment

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

Let's try to have reproducible results by requiring a specific version of golangci-lint pinned in go.mod?
https://go.dev/doc/go1.24#tools

Comment on lines +95 to +98
// Extra buffer so that flaky startup races are less likely.
if err := sh.RunV("sleep", "30"); err != nil {
fmt.Println("warning: sleep command failed:", err)
}
Copy link
Member

Choose a reason for hiding this comment

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

Is there a condition we could retry quering until it is satisfied?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants