Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 9, 2025. It is now read-only.

Conversation

@gauravkghildiyal
Copy link
Member

Let's improve test debuggability by logging both the "got" and "want" outputs when a test fails. This follows the best practice outlined in https://bats-core.readthedocs.io/en/stable/faq.html#how-do-i-see-the-output-of-the-command-under-run-when-a-test-fails

Example of test failure:

 ✗ dummy interface with IP addresses ResourceClaim
   (from function `assert_output' in file tests/test_helper/bats-assert/src/assert.bash, line 231,
    in test file tests/e2e.bats, line 18)
     `assert_output --partial "169.254.169.255"' failed
   deviceclass.resource.k8s.io/dra.net created
   resourceclaim.resource.k8s.io/dummy-interface-static-ip created
   pod/pod1 created
   pod/pod1 condition met
   
   -- output does not contain substring --
   substring : 169.254.169.255
   output    : 169.254.169.13/24
   --

Copy link
Collaborator

@aojea aojea left a comment

Choose a reason for hiding this comment

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

at one point we need to decide if we move everything to git and make this self containerd and more consistent removing the existing github action, but that can be a follow up

https://bats-core.readthedocs.io/en/stable/tutorial.html#quick-installation

@aojea aojea merged commit 66de5dd into google:main Jun 24, 2025
6 of 7 checks passed
@gauravkghildiyal gauravkghildiyal deleted the bats-improvements branch June 24, 2025 21:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants