From 739d47b6a14f93cf122955a21b49ae2978b0e71d Mon Sep 17 00:00:00 2001 From: Sam Debruyn Date: Tue, 13 Sep 2022 12:02:12 +0200 Subject: [PATCH] enable grants tests and fix env file lookup --- Makefile | 2 +- docker-compose.yml | 2 + tests/functional/adapter/test_grants.py | 50 ++++++++++++------------- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Makefile b/Makefile index 2ac711cb..404224ea 100644 --- a/Makefile +++ b/Makefile @@ -57,7 +57,7 @@ test: ## Runs unit tests and code checks against staged changes. .PHONY: server server: ## Spins up a local MS SQL Server instance for development. Docker-compose is required. @\ - docker compose --env-file test.env up -d + docker compose up -d .PHONY: clean @echo "cleaning repo" diff --git a/docker-compose.yml b/docker-compose.yml index 162ec416..875fc64b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,4 +19,6 @@ services: SQLCMDPASSWORD: "L0calTesting!" SQLCMDSERVER: sqlserver SQLCMDDBNAME: msdb + env_file: + - test.env command: sh -c "/mnt/scripts/wait-for-it.sh sqlserver:1433 -t 60 -- sleep 5 && /opt/mssql-tools/bin/sqlcmd -b -I -i /mnt/scripts/create_sql_users.sql" diff --git a/tests/functional/adapter/test_grants.py b/tests/functional/adapter/test_grants.py index a8ddb560..eb330cb9 100644 --- a/tests/functional/adapter/test_grants.py +++ b/tests/functional/adapter/test_grants.py @@ -1,25 +1,25 @@ -# from dbt.tests.adapter.grants.test_incremental_grants import BaseIncrementalGrants -# from dbt.tests.adapter.grants.test_invalid_grants import BaseInvalidGrants -# from dbt.tests.adapter.grants.test_model_grants import BaseModelGrants -# from dbt.tests.adapter.grants.test_seed_grants import BaseSeedGrants -# from dbt.tests.adapter.grants.test_snapshot_grants import BaseSnapshotGrants -# -# -# class TestIncrementalGrantsSQLServer(BaseIncrementalGrants): -# pass -# -# -# class TestInvalidGrantsSQLServer(BaseInvalidGrants): -# pass -# -# -# class TestModelGrantsSQLServer(BaseModelGrants): -# pass -# -# -# class TestSeedGrantsSQLServer(BaseSeedGrants): -# pass -# -# -# class TestSnapshotGrantsSQLServer(BaseSnapshotGrants): -# pass +from dbt.tests.adapter.grants.test_incremental_grants import BaseIncrementalGrants +from dbt.tests.adapter.grants.test_invalid_grants import BaseInvalidGrants +from dbt.tests.adapter.grants.test_model_grants import BaseModelGrants +from dbt.tests.adapter.grants.test_seed_grants import BaseSeedGrants +from dbt.tests.adapter.grants.test_snapshot_grants import BaseSnapshotGrants + + +class TestIncrementalGrantsSQLServer(BaseIncrementalGrants): + pass + + +class TestInvalidGrantsSQLServer(BaseInvalidGrants): + pass + + +class TestModelGrantsSQLServer(BaseModelGrants): + pass + + +class TestSeedGrantsSQLServer(BaseSeedGrants): + pass + + +class TestSnapshotGrantsSQLServer(BaseSnapshotGrants): + pass