Skip to content

Conversation

@mafredri
Copy link
Member

@mafredri mafredri commented Dec 11, 2025

Previously the GetTemplateVersionVariables query did not sort output,
relying on PostgreSQL on-disk ordering which is undeterministic.

Variables are now sorted by name because there is no alternative for
ordering.

Tests were adjusted to accommodate the new ordering, previously they
relied on data being written to disk in insert order.


While updating the test, the rest of the test file was modernized and
context usage adjusted.

@mafredri mafredri changed the title test(cli): modernize TestTemplatePush and fix contexts fix(coderd): sort template version variables and fix test flake Dec 11, 2025
@mafredri mafredri changed the title fix(coderd): sort template version variables and fix test flake fix(coderd/database): sort template version variables and fix test flake Dec 11, 2025
pty.ExpectMatch("var.string_var")
pty.ExpectMatch("Enter value:")
pty.WriteLine("test-string")
// Variables are prompted in alphabetical order.
Copy link
Member Author

Choose a reason for hiding this comment

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

Review: Below is the actual test flake fix, combined with the query ordering.

@mafredri mafredri marked this pull request as ready for review December 11, 2025 19:51
@mafredri mafredri force-pushed the mafredri/test-fix-testtemplatepush-ctx branch from cdc3cf4 to 8ef85c8 Compare December 12, 2025 09:56
@mafredri mafredri enabled auto-merge (squash) December 12, 2025 10:05
@mafredri mafredri merged commit 761dd55 into main Dec 12, 2025
51 of 53 checks passed
@mafredri mafredri deleted the mafredri/test-fix-testtemplatepush-ctx branch December 12, 2025 11:41
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants