-
Notifications
You must be signed in to change notification settings - Fork 0
Samples
Giacomo Castellani edited this page Jul 26, 2024
·
3 revisions
Clone or download the repo.
Go to the root folder of the project and run:
docker build -f bundle.dockerfile . -t qest:bundle
Then, switch ti the samples
folder and run:
docker build . -t qestsamples
docker run --rm -t qestsamples
In the sample
folder run:
dotnet build ./sampleDb/ -c Release -o ./dacpac
Then run the command:
docker run --rm -t \
-v {full/local/path}/tests:/tests \
-v {full/local/path}/scripts:/scripts \
-v {full/local/path}/dacpac:/db \
--env DACPAC={filename} \
ghcr.io/geims83/qest:bundle
In the main folder of the repo:
task dev:samples:run
The output should look like this:
SampleSP / Test Error / Command / dbo.SampleSp @name = 'NoMatchData', @newValue = NULL
System.Data.SqlClient.SqlException: Procedure or function 'SampleSP' expects parameter '@newValue', which was not supplied.
[...]
SampleSP / After / DELETE dbo.SampleTable
WHERE [Name] = 'SampleName'
SampleSP / After / OK
SampleSP / KO!
exit status 1
Yeah, I like to have a test that go bad so I'm sure that qest is doing right ;)
To fix it, you go to the test definition in the samples/tests
folder and change line 174 from NULL
to some value.
You also need to change the RC that the procedure returns from 0 to 1 on line 176.
Now build / run the image again and everything runs smoothly!