Skip to content

Replace Go tests with BATS and remove Go dependency#579

Merged
jnovy merged 1 commit intocontainers:mainfrom
jnovy:bats
Aug 28, 2025
Merged

Replace Go tests with BATS and remove Go dependency#579
jnovy merged 1 commit intocontainers:mainfrom
jnovy:bats

Conversation

@jnovy
Copy link
Collaborator

@jnovy jnovy commented Aug 25, 2025

Reimplemented all tests from Go to BATS framework, providing comprehensive test coverage while eliminating Go build dependencies. Added 50 BATS tests covering basic functionality, container logging, k8s log rotation, and full runtime integration with real container execution.

Fixes: #577

@jnovy jnovy requested review from haircommander and mheon August 25, 2025 11:09
@jnovy jnovy added the jira label Aug 26, 2025
@jnovy jnovy requested a review from giuseppe August 27, 2025 13:14
}

@test "ctr logs: log driver as journald with short cid should fail" {
local short_ctr_id="abcdefghijkl"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

actually a number of these do

@@ -1,19 +0,0 @@
package config
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we know nothing imports these still? I did feel clever about generating them but we never actually changed it really so I understand dropping

Reimplemented all tests from Go to BATS framework, providing comprehensive
test coverage while eliminating Go build dependencies. Added 52 BATS tests
covering basic functionality, container logging, k8s log rotation, and
full runtime integration with real container execution.

Fixes: containers#577

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Jindrich Novy <jnovy@redhat.com>
@jnovy
Copy link
Collaborator Author

jnovy commented Aug 28, 2025

Thanks @haircommander for the review - the two tests were indeed duplicated.

Duplicate Tests Fixed:

  • Removed duplicate "log driver as journald with short cid should fail" test from test/02-ctr-logs.bats (kept the original in test/01-basic.bats)
  • Removed duplicate "log driver as k8s-file with path should pass" test from test/02-ctr-logs.bats (kept the original in test/01-basic.bats)

Seems no remaining files import or reference the deleted modules (runner/config, runner/conmon, cmd/conmon-config).

@jnovy jnovy requested a review from haircommander August 28, 2025 10:13
@haircommander
Copy link
Collaborator

LGTM, thanks!

@jnovy jnovy merged commit 84edf22 into containers:main Aug 28, 2025
31 of 34 checks passed
@ricardobranco777
Copy link
Contributor

Thanks for these tests. I could backport this to run on conmon 2.1.13 and 2.1.10 for openSUSE & SUSE and they pass on all arches.

os-autoinst/os-autoinst-distri-opensuse#23163

@jnovy
Copy link
Collaborator Author

jnovy commented Sep 1, 2025

Perfect, thanks for confirming @ricardobranco777

@jnovy jnovy deleted the bats branch September 1, 2025 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace golang tests with BATS and remove golang dependency

3 participants