Skip to content

T9665: Update dune tests - #66

Merged
dmbaturin merged 5 commits into
vyos:rollingfrom
jestabro:dune-test
Nov 23, 2026
Merged

dmbaturin merged 5 commits into
vyos:rollingfrom
jestabro:dune-test

Conversation

@jestabro

Copy link
Copy Markdown
Contributor

Change Summary

Dune test is now run by PR actions. Update tests for changes to vyos1x-config and vyconf.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Other (please describe): update dune tests for consistency

Related Task(s)

Related PR(s)

Proposed changes

How to test

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@jestabro jestabro self-assigned this Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated hostname validation test data to require at least one character after the initial letter.
    • Expanded configuration fixtures to cover reference-tree and session directories, along with their associated files.
    • Updated reference-tree and value-validation test expectations and setup.

The changes update test configuration and fixtures, switch reference-tree tests to RT.default, and adjust value-checker test annotations and expectations.

Changes: Test configuration and validation

Layer / File(s) Summary
Test environment and configuration
test/data/vyconfd_config/vyconfd.conf.complete:8-21, test/data/vyconfd_config/vyconfd.conf.mandatoryonly:8-20, test/dune:1-6
Both configuration fixtures add reftree and session paths. The Dune test environment defines libexec and validator directories.
Reference-tree test initialization
test/reference_tree_test.ml:20-180
Tests use RT.default instead of constructing trees with VT.make. Existing assertions remain unchanged.
Validation fixtures and tests
test/data/interface_definition_sample.xml:34, test/value_checker_test.ml:18-47
The host-name pattern requires a character after its initial letter. Value-checker calls add exn alert annotations, and the invalid validate_any test expects Some "".
Merge Risk: Minimal · up to 28684

This change only updates Dune test fixtures, configuration and expectations to match vyos1x-config and vyconf. No production behavior changes and no concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "T9665: Update dune tests" matches the main change. The changeset updates Dune test setup and test data (reference tree tests, value checker tests, dune environment variables, and config sam…
Description check Passed The description states that Dune tests are now run by PR actions and that the tests were updated for changes to vyos1x-config and vyconf. This relates directly to the changeset. It omits detailed test…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "T9665: Update dune tests" matches the main change. The changeset updates Dune test setup and test data (reference tree tests, value checker tests, dune environment variables, and config samples) to match changes in vyos1x-config and vyconf. The title names the task ID and the primary change, though it does not name the specific test updates.

Full details: Description check

Explanation

The description states that Dune tests are now run by PR actions and that the tests were updated for changes to vyos1x-config and vyconf. This relates directly to the changeset. It omits detailed test commands and results, but the check is lenient on detail.

Finishing Touches

Simplify code

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: vyos/vyconf
  • Branch: rolling
  • File: .coderabbit.yaml
  • Commit: ca209bc
  • Layers: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 5ca259ce-87f1-4e32-9a1b-86eacf3d8773
Commits

Reviewing files that changed from the base of the PR and between ca209bc and 2868454.

Files selected for processing: 6

  • test/data/interface_definition_sample.xml
  • test/data/vyconfd_config/vyconfd.conf.complete
  • test/data/vyconfd_config/vyconfd.conf.mandatoryonly
  • test/dune
  • test/reference_tree_test.ml
  • test/value_checker_test.ml
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Recent review details

Context from checks skipped due to timeout: 3

  • GitHub Check: CodeRabbit
  • GitHub Check: build (ubuntu-latest, 5.2)
  • GitHub Check: build (ubuntu-latest, 4.14)
Additional context used

Code guidelines: 1

1 repository guideline source
Path-based instructions: 1

Write unit tests using the ounit2 test framework and place them in the test/ directory

CodeRabbit inference engine

Files:

  • test/reference_tree_test.ml
  • test/value_checker_test.ml
Remote MCP Context7

Context7

  • Dune’s current documentation says env_vars sets variables for build commands and dune exec; the dashed env-vars spelling is supported. The field is documented as available since Dune 3.24. (Source: Context7 · query-docs)
  • Dune documents (env_var VAR) as tracking changes to a variable’s value. Sandboxed actions can still access absolute paths outside the sandbox, relevant to the tests’ validator directories. (Source: Context7 · query-docs)
Additional comments: 2

test/value_checker_test.ml: 1

47-47: Functional Correctness

The Some "" expectation matches the vyos1x-config implementation this repository builds against.

The updated assertion at test/value_checker_test.ml:47 expects Some "" for "AAAA" with the two regex constraints. The current validate_any returns Some "" in this case. Both regexes fail without writing a message to the buffer, so the buffered output stays empty. No change is needed for this assertion.

test/reference_tree_test.ml: 1

20-20: Functional Correctness

The RT.default call in test/reference_tree_test.ml:20 does not cause a compilation failure under the repository's supported dependency setup. CI pins vyos1x-config to rolling, and the rolling Reference_tree module defines default. The opam file has no version bound, but no other supported version is named.

@mergify mergify Bot added the rolling label Nov 21, 2026
@mergify

mergify Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

This pull request is merged.

@jestabro
jestabro requested a review from dmbaturin November 21, 2026 05:49

@dmbaturin dmbaturin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's a straightforward refresh, I see no issues.

@dmbaturin
dmbaturin merged commit 8a8810b into vyos:rolling Nov 23, 2026
9 checks passed
@vyos-bot vyos-bot Bot added mirror-initiated This PR initiated for mirror sync workflow mirror-completed This PR has been mirrored successfully and removed mirror-initiated This PR initiated for mirror sync workflow labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mirror-completed This PR has been mirrored successfully rolling

Development

Successfully merging this pull request may close these issues.

2 participants