Skip to content

Conversation

@audunmg
Copy link
Collaborator

@audunmg audunmg commented Dec 12, 2025

Test ergonomics aren't great, so let's improve it.

@audunmg
Copy link
Collaborator Author

audunmg commented Dec 12, 2025

Proposition 1: basically use bats syntax better.

use run to capture output in $output and check return status with $status when needed.

Everything printed in the test will be output when the test fails, so feel free to produce nice error messages.

Every line need to succeed for the test to succeed, so adding multiple commands to test things in a single test is OK as long as it makes sense.

@audunmg
Copy link
Collaborator Author

audunmg commented Dec 12, 2025

The second commit is not finished.

It's just a suggestion to have a bash function to create a shorter "helm template test", since that's most of the tests.

(it is what breaks tests right now in this PR)

}

helm_template_compare {
local valuefile="${BATS_TMPDIR}/values-${BATS_TEST_NUMBER}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

smart!

@gquintard
Copy link
Collaborator

@briiians ^ this should simplify your tests

briiians added a commit to briiians/helm-varnish that referenced this pull request Dec 16, 2025
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