Repository navigation
Enable database upgrade testing in the CI - #331
Merged
Merged
Conversation
ValidateUpgradedOrchestrations has been skipped since it was added, because
RESTORE DATABASE is executed by SQL Server rather than by the test process: the
backup file has to exist on the server's file system, which in CI is inside the
mssql-server container and not the runner's working directory.
Stage the backup into the container with docker cp before restoring, falling
back to the local path when SQL Server is installed locally. The container is
discovered automatically, and DTFX_TEST_SQL_CONTAINER overrides the name (or
disables the behavior with "none").
The v1.0.0 backup was taken on Windows, so the data and log file paths recorded
in it can't be honored by a Linux container. Relocate both files to the target
server's default data directory during the restore.
Also fix the test itself, which had rotted while skipped:
* Expect schema-1.6.0.sql in the log assertions. An upgrade from 1.0.0 executes
every newer schema script, and the list had not been updated since 1.2.0.
* Add [Collection("Integration")], which every other integration test class
already has. Without it, DROP/RESTORE DATABASE runs concurrently with
DatabaseManagement's CREATE DATABASE and they contend on model.
* Raise the orchestration waits to 60s, since instances resume against a
freshly restored database with a cold plan cache.
* Stop the task hub worker when finished, rather than leaving it polling the
restored database for the lifetime of the test process.
Contributor
Author
|
Chris Gillum (@cgillum) could please take a look? Thank you. |
Member
|
Pinging Tomer Rosenthal (@torosent) and andystaples to help take a look at this PR. |
Contributor
|
Documenting, not blocking:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #152
ValidateUpgradedOrchestrationshas been skipped since it was added, becauseRESTORE DATABASEis executed by SQL Server rather than by the test process: the backup file has to exist on the server's file system, which in CI is inside themssql-servercontainer and not the runner's working directory.Stage the backup into the container with
docker cpbefore restoring, falling back to the local path when SQL Server is installed locally. The container is discovered automatically, andDTFX_TEST_SQL_CONTAINERoverrides the name (or disables the behavior with "none").The v1.0.0 backup was taken on Windows, so the data and log file paths recorded in it can't be honored by a Linux container. Relocate both files to the target server's default data directory during the restore.
Also fix the test itself, which had rotted while skipped:
schema-1.6.0.sqlin the log assertions. An upgrade from 1.0.0 executes every newer schema script, and the list had not been updated since 1.2.0.[Collection("Integration")], which every other integration test class already has. Without it,DROP/RESTORE DATABASEruns concurrently withDatabaseManagement'sCREATE DATABASEand they contend on model.