Skip to content

ENT-14444: Added cfengine test i2, now reports a test-suite using the assert-promise module - #250

Open
SimonThalvorsen wants to merge 4 commits into
cfengine:mainfrom
SimonThalvorsen:test-test
Open

SimonThalvorsen wants to merge 4 commits into
cfengine:mainfrom
SimonThalvorsen:test-test

Conversation

@SimonThalvorsen

Copy link
Copy Markdown
Contributor

Runs test_*.cf files or a deployed policy's own assert: promises (or just a plain built-policy run) in disposable Docker container and reports a pytest-style pass/fail summary.
Adds --dockerfile/--rebuild flags for testing against a custom base image.

Ticket: ENT-14444

@codecov

codecov Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.76847% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.75%. Comparing base (4a3918d) to head (b052f2f).
⚠️ Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/cfengine_cli/container.py 98.91% 3 Missing ⚠️
...cfengine_cli/cfengine_wrapper/cfengine_commands.py 90.00% 1 Missing ⚠️
src/cfengine_cli/commands.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #250      +/-   ##
==========================================
+ Coverage   55.05%   58.75%   +3.69%     
==========================================
  Files          33       34       +1     
  Lines        4299     4689     +390     
==========================================
+ Hits         2367     2755     +388     
- Misses       1932     1934       +2     
Files with missing lines Coverage Δ
src/cfengine_cli/main.py 61.94% <100.00%> (+0.62%) ⬆️
src/cfengine_cli/report.py 100.00% <100.00%> (ø)
...cfengine_cli/cfengine_wrapper/cfengine_commands.py 34.24% <90.00%> (+1.22%) ⬆️
src/cfengine_cli/commands.py 58.03% <87.50%> (+0.09%) ⬆️
src/cfengine_cli/container.py 98.95% <98.91%> (+9.48%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@olehermanse

Copy link
Copy Markdown
Member

@SimonThalvorsen is this done and ready for review?

@SimonThalvorsen

Copy link
Copy Markdown
Contributor Author

@SimonThalvorsen is this done and ready for review?

@olehermanse partly. The general idea is there, have put it on hold for now, so not super well tested, but feedback is welcome

@SimonThalvorsen
SimonThalvorsen force-pushed the test-test branch 4 times, most recently from e9b771b to d53247c Compare November 9, 2026 14:41
@SimonThalvorsen
SimonThalvorsen marked this pull request as draft November 9, 2026 15:26
@SimonThalvorsen
SimonThalvorsen force-pushed the test-test branch 2 times, most recently from 1cbb1dc to 0e75c4f Compare November 10, 2026 12:48
SimonThalvorsen and others added 4 commits November 10, 2026 14:34
…-promise module

Runs test_*.cf files or a deployed policy's own assert: promises
(or just a plain built-policy run) in disposable Docker container
and reports a pytest-style pass/fail summary.
In a cfbs project, each test file runs at the end of the project's real
promises.cf (with its fixture applied); --test-only runs just the test
bundles from a minimal generated policy instead.
Adds --dockerfile/--rebuild flags for testing against a custom base image.

Ticket: ENT-14444
Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
Covers the assert promise vocabulary, a standalone test suite (auto-discovery
and an explicit directory argument), a cfbs project suite with a local module,
and the full-policy default versus --test-only.

Ticket: ENT-14444
Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
Ticket: ENT-14444
Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
Ticket: ENT-14444
Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Simon Halvorsen <simon.halvorsen@northern.tech>
@SimonThalvorsen
SimonThalvorsen marked this pull request as ready for review November 10, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants