Skip to content

Conversation

@amoeba
Copy link
Member

@amoeba amoeba commented Dec 17, 2025

Adds a mechanism for running tests for the user and system config levels and adds a basic installation test for both config levels. The goal here is not to completely replicate the existing tests but to give us a way to test special cases of interest.

The approach here creates a new test suite class and standalone files instead of mixing them into other test suites and they are intentionally hard to run because they are potentially dangerous. And I wasn't able to find a good mechanism to do something more like Python or Rust where it's easier to mix tests together.

Tests are in integration_user_test.go and integration_system_test.go. I split these up because, in CI, I want to test the user level tests without sudo and the system level tests with sudo. There are other ways to work around this but I feel better just testing what the users would run directly.

You have to run the tests like,

# user
$ DBC_RUN_INTEGRATION_TESTS=1 go test -tags test_integration,test_system
#system
$ DBC_RUN_INTEGRATION_TESTS=1 go test -tags test_integration,test_user

This PR enables them in CI for all commits.

Closes #210

@amoeba
Copy link
Member Author

amoeba commented Dec 19, 2025

Closing in favor of #239.

@amoeba amoeba closed this Dec 19, 2025
zeroshade pushed a commit that referenced this pull request Jan 5, 2026
Extends the SubCommandTest test suite to be parameterized by configLevel
so the subcommand tests can be run with `--level` set to user or system
by running the test suite with `DBC_TEST_LEVEL_USER=1` or
`DBC_TEST_LEVEL_SYSTEM=1` respectively.

This is not enabled by default on developer machines but is enabled in
CI. To opt in this behavior, tests need to be written to use
`suite.configLevel` to control their config level and tests can opt out
either by not doing this or by doing this but adding appropriate Skips.

To demo what we can do now, this PR also includes a fix for #215. We
could have fixed the issue by testing in a tempdir but with the change
in this PR we can actually test the bug that was reported. Doing this
also uncovered some edge cases in the symlink behavior so this was time
well spent.

Also fixes a minor undiscovered bug in removing manifest-only drivers:
e69744f.

Supersedes #238
Closes #210 
Closes #215
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.

Enable testing user and system level configs in ci

1 participant