bottlerocket-os / bottlerocket-os/bottlerocket-core-kit

Provide targeted migration testing

Open
#420 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Rust
Stars
34
Forks
77
Avg merge
2d 23h
Merged PRs (30d)
23

Description

**What I'd like:**

Migrations are currently tested manually or via testsys as full version migrations. This is a larger effort, so it usually doesn't happen until late in the development cycle, usually around release time.

There are a few unit tests for the `migrator`, but these are low level tests of fine grained functionality.

I would love to see something in the middle here. Something that could be used as a GitHub Action job would only trigger when anything under `sources/api/migration` changes. It shouldn't be too difficult to implement a light testing harness that would use a lot of the existing functions that could perform a targeted migration and verify the resulting datastore settings match what is expected. This would bypass the need with `migrator` to have a TUF repo, full version builds, etc.

I think this could work by doing something like `git checkout HEAD~1`, build `storewolf` with the pre-change version (which will generate the `defaults.toml` file for all settings). Then use that version of `storewolf` to create a temporary local datastore. Then use this test harness to just run the new/changed migration on that datastore. It would then validate the migration exited successfully and inspect the current datastore settings to make sure they match what is expected post-migration. Then run a downgrade migration and verify the datastore settings match the original settings.

**Any alternatives you've considered:**

Stick with full migration testing using testsys.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.