Skip to content

Added tests for schema migration#220

Open
Electricschmidt wants to merge 2 commits intoTimmoth:mainfrom
Electricschmidt:main
Open

Added tests for schema migration#220
Electricschmidt wants to merge 2 commits intoTimmoth:mainfrom
Electricschmidt:main

Conversation

@Electricschmidt
Copy link

Tests for issue #179. There's a bit of a question about whether or not the List<object> case in the ConvertScalarRunsOnToList is really valid also as I think the yaml would fail validation prior to this right?

@Timmoth
Copy link
Owner

Timmoth commented Mar 2, 2026

Thanks for that Tom!

What I had in mind was that we'd use the versioned YAML files in the test project (currently used in the schema validation tests https://github.com/Timmoth/RackPeek/blob/main/Tests/Yaml/SchemaTests.cs)

So the test would look like one of the other e2e CLI tests (choose an arbitrary command like 'summary') since they read / migrate / save the source yaml file on startup.

e.g

for each v1 yaml file
copy v1 file to temp (isolated) test directory
run summary command (load / migrate / save)
assert saved file matches corresponding v2 yaml file 
assert backup file matches v1 yaml file 

Then we just have to make sure there exists at least one v1 yaml file which exhibits a property that needs migrating.

WDYT?

@Electricschmidt
Copy link
Author

Yeah, that sounds more useful long term tbf. I wrote these barebones tests mostly just to see if I understood what the expectation was but I can look at doing the e2e versions instead

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.

2 participants