From 55e39b867f6eccc18cf83de93088921fc80ca11f Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" Date: Mon, 20 Nov 2023 21:39:13 +0700 Subject: [PATCH] chore: try add test for dev-url --- .github/workflows/ci.yml | 9 +++++++-- integration-tests/.gitignore | 5 +++++ integration-tests/no-dev-url/main.tf | 18 ++++++++++++++++++ integration-tests/no-dev-url/schema.sql | 5 +++++ integration-tests/sqlite/.gitignore | 3 --- 5 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 integration-tests/.gitignore create mode 100644 integration-tests/no-dev-url/main.tf create mode 100644 integration-tests/no-dev-url/schema.sql delete mode 100644 integration-tests/sqlite/.gitignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 90c0ee2..0e75813 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,5 +151,10 @@ jobs: ../../scripts/local.sh ../../dist 0.0.0-pre.0 terraform init terraform apply --auto-approve - env: - TF_LOG: DEBUG + - name: Terraform (no-dev-url) + working-directory: integration-tests/no-dev-url + run: | + ../../scripts/local.sh ../../dist 0.0.0-pre.0 + terraform init + terraform plan -no-color > stdout.txt + cat no-dev-url.txt | grep "Warning: dev_url is unset" diff --git a/integration-tests/.gitignore b/integration-tests/.gitignore new file mode 100644 index 0000000..0fcbc58 --- /dev/null +++ b/integration-tests/.gitignore @@ -0,0 +1,5 @@ +**/.terraform.lock.hcl +**/.terraform/* +**/terraform.d +**/*.db +**/stdout.txt \ No newline at end of file diff --git a/integration-tests/no-dev-url/main.tf b/integration-tests/no-dev-url/main.tf new file mode 100644 index 0000000..b5d83f9 --- /dev/null +++ b/integration-tests/no-dev-url/main.tf @@ -0,0 +1,18 @@ +terraform { + required_providers { + atlas = { + source = "ariga/atlas" + version = "0.0.0-pre.0" + } + } +} + +data "atlas_schema" "db" { + src = "file://schema.sql" + dev_url = "sqlite://file?mode=memory" +} + +resource "atlas_schema" "db" { + hcl = data.atlas_schema.db.hcl + url = "sqlite://file.db" +} diff --git a/integration-tests/no-dev-url/schema.sql b/integration-tests/no-dev-url/schema.sql new file mode 100644 index 0000000..311a139 --- /dev/null +++ b/integration-tests/no-dev-url/schema.sql @@ -0,0 +1,5 @@ +CREATE TABLE t1 ( + c1 INT, + c2 TEXT, + PRIMARY KEY (c1) +); diff --git a/integration-tests/sqlite/.gitignore b/integration-tests/sqlite/.gitignore deleted file mode 100644 index 6e69145..0000000 --- a/integration-tests/sqlite/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.terraform.lock.hcl -.terraform/* -terraform.d