Run SQL server tests on Azure SQL Edge #714
Merged
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.
While taking a look at floating #666 on an internal fork, I learned that the mssql images are x86 only. This means that if you run the tests on an m1 mac today, a bunch of them will fail.
Microsoft is a long way from releasing an arm build of SQL Server, so we can't really wait on it. However, they've released an IOT flavor of SQL Server called Azure SQL Edge which does have arm builds (fun fact, it can run on a raspberry pi) and which is in many cases a drop-in replacement.
tl;dr: This PR adds this image to the tested specs in
sqlserver_test.go
and only adds the existingmssql
images if the runtime architecture is x64-compatible.Note, I did some slightly funky things with setting up the edge container spec and the port lookup. The current logic assumes that there's only one exposed port on any given image and grabs "the first one" in multiple cases. Unlike the mssql images, the edge image exposes a handful of other ports that coincidentally get listed prior to the port we actually want - hence, manually setting the port to the one we expect and manually passing a port map to the edge options.
I have mssql tests with edge passing locally, and I have the full mssql test suite passing in our org's fork. However, the CI tests aren't passing here. I believe these failures are due to other databases and I consider fixing those out-of-scope for this change, so I haven't attempted to fix these non-mssql tests.