-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit '9d9c333b15068df7709baf722dd2e1e27787b2d0'
Update subtree
- Loading branch information
Showing
8 changed files
with
102 additions
and
20 deletions.
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
Libraries/sp_alter_column/.github/workflows/unit-test-runner.yml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# This workflow installs tSQLt and runs the test units | ||
|
||
name: tSQLt installer and unit testing runner | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "master" branch | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
windows-auth-tsqlt: | ||
name: Installting tSQLt with SQL Auth | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
services: | ||
sqlserver: | ||
image: mcr.microsoft.com/mssql/server:2022-latest | ||
ports: | ||
- 1433:1433 | ||
env: | ||
ACCEPT_EULA: Y | ||
SA_PASSWORD: 3uuiCaKxfbForrK | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install tSQLt with SQL auth | ||
uses: lowlydba/tsqlt-installer@v1 | ||
with: | ||
sql-instance: localhost | ||
database: tempdb | ||
version: latest | ||
user: sa | ||
password: 3uuiCaKxfbForrK | ||
|
||
#- name: Get the containers list unformatted | ||
# run: docker ps | ||
|
||
#- name: Get the containers list formatted | ||
# run: docker ps --all --filter status=running --no-trunc --format "{{.ID}}" | ||
|
||
#- name: Set the container ID | ||
# run: echo '::set-output name=CONTAINER_ID::$(docker ps --all --filter status=running --no-trunc --format "{{.ID}}")' | ||
# id: ContainerID | ||
|
||
#- name: Get container ID | ||
# run: echo "The container ID is ${{ steps.ContainerID.outputs.CONTAINER_ID }}" | ||
|
||
- name: Set environment variable ENV_CONTAINER_ID | ||
run: echo "ENV_CONTAINER_ID=$(docker ps --all --filter status=running --no-trunc --format "{{.ID}}")" >> $GITHUB_ENV | ||
|
||
- name: Test environment variable ENV_CONTAINER_ID | ||
run: echo $ENV_CONTAINER_ID | ||
|
||
#- name: Print environment variables | ||
# run: env | ||
|
||
- name: Get the database list | ||
run: docker exec -i $ENV_CONTAINER_ID /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "3uuiCaKxfbForrK" -Q "SELECT Name FROM sys.databases" | ||
|
||
- name: Copy file sp-alter-column.sql into ENV_CONTAINER_ID | ||
run: docker cp ./source/sp-alter-column.sql $ENV_CONTAINER_ID:/ | ||
|
||
- name: Create the system under test (SUT) sp_alter_column | ||
run: docker exec -i $ENV_CONTAINER_ID /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "3uuiCaKxfbForrK" -d tempdb < ./source/sp-alter-column.sql | ||
|
||
#- name: Get the stored procedures list | ||
# run: docker exec -i $ENV_CONTAINER_ID /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "3uuiCaKxfbForrK" -d tempdb -Q "SELECT Name FROM sys.procedures" | ||
|
||
- name: Create tSQLt test class for sp_alter_column | ||
run: docker exec -i $ENV_CONTAINER_ID /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "3uuiCaKxfbForrK" -d tempdb -Q "EXEC tSQLt.NewTestClass 'UnitTestAlterColumn'" | ||
|
||
- name: Create and run unit test [test alter column with PK] | ||
run: docker exec -i $ENV_CONTAINER_ID /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "3uuiCaKxfbForrK" -d tempdb < ./unit-test/sp-alter-column-unit-test-30-test-alter-column-with-PK.sql | ||
|
||
- name: Create and run unit test [test alter column with FK] | ||
run: docker exec -i $ENV_CONTAINER_ID /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "3uuiCaKxfbForrK" -d tempdb < ./unit-test/sp-alter-column-unit-test-31-test-alter-column-with-FK.sql | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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