From 287aad9f255e39817965a0dbf11def15f3359080 Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Fri, 26 Apr 2024 16:08:02 +0200 Subject: [PATCH 1/6] test-locally: add TestAccOthers_LBU_basic Signed-off-by: Matthias Gatto --- GNUmakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/GNUmakefile b/GNUmakefile index 7f149de46..090e3612b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -69,6 +69,7 @@ test-compile: test-locally: "$(CURDIR)/scripts/local-test.sh" TestAccOthers_Volume_io1Type "$(CURDIR)/scripts/local-test.sh" TestAccVM_withFlexibleGpuLink_basic + "$(CURDIR)/scripts/local-test.sh" TestAccOthers_LBU_basic .PHONY: terraform-examples terraform-examples: From fe43e08d35f9dc6fec87f753b5a010d33f737150 Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Mon, 3 Jun 2024 12:00:58 +0200 Subject: [PATCH 2/6] test-locally: add more tests Signed-off-by: Matthias Gatto --- GNUmakefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 090e3612b..06db909c2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -67,8 +67,16 @@ test-compile: .PHONY: test-locally test-locally: - "$(CURDIR)/scripts/local-test.sh" TestAccOthers_Volume_io1Type + "$(CURDIR)/scripts/local-test.sh" TestAccVM_Basic + "$(CURDIR)/scripts/local-test.sh" TestAccVM_Behavior_Basic + "$(CURDIR)/scripts/local-test.sh" TestAccVM_withTags + "$(CURDIR)/scripts/local-test.sh" TestAccVM_importBasic "$(CURDIR)/scripts/local-test.sh" TestAccVM_withFlexibleGpuLink_basic + "$(CURDIR)/scripts/local-test.sh" TestAccVM_UpdateKeypair + "$(CURDIR)/scripts/local-test.sh" TestAccVM_UpdateDeletionProtection + "$(CURDIR)/scripts/local-test.sh" TestAccVM_multiBlockDeviceMapping + "$(CURDIR)/scripts/local-test.sh" TestAccOthers_DataSourceFlexibleGpu_basic + "$(CURDIR)/scripts/local-test.sh" TestAccOthers_Volume_io1Type "$(CURDIR)/scripts/local-test.sh" TestAccOthers_LBU_basic .PHONY: terraform-examples From 0e4c67fddb37ac76c1c07c4b2eff2a6100faf999 Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Mon, 24 Jun 2024 16:16:28 +0200 Subject: [PATCH 3/6] fix TestAccVM_withImageExportTasksDataSource_basic Signed-off-by: Matthias Gatto --- .../data_source_outscale_image_export_tasks_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/outscale/data_source_outscale_image_export_tasks_test.go b/outscale/data_source_outscale_image_export_tasks_test.go index e1da2f085..4a6f4e79d 100644 --- a/outscale/data_source_outscale_image_export_tasks_test.go +++ b/outscale/data_source_outscale_image_export_tasks_test.go @@ -38,11 +38,22 @@ func TestAccVM_withImageExportTasksDataSource_basic(t *testing.T) { func testAccOutscaleImageExportTasksDataSourceConfig(omi, vmType, region, imageName string) string { return fmt.Sprintf(` + resource "outscale_security_group" "sg_task" { + security_group_name = "sg_export_task" + description = "Used in the terraform acceptance tests" + + tags { + key = "Name" + value = "tf-acc-test" + } + } + resource "outscale_vm" "basic" { image_id = "%s" vm_type = "%s" keypair_name = "terraform-basic" placement_subregion_name = "%sa" + security_group_ids = [outscale_security_group.sg_task.security_group_id] } resource "outscale_image" "foo" { From c858005668dabab0c69c4716d828790c0a7c2430 Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Thu, 4 Jul 2024 16:55:13 +0200 Subject: [PATCH 4/6] test-locally: add more tests Signed-off-by: Matthias Gatto --- GNUmakefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index 06db909c2..aae3fab31 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -73,11 +73,18 @@ test-locally: "$(CURDIR)/scripts/local-test.sh" TestAccVM_importBasic "$(CURDIR)/scripts/local-test.sh" TestAccVM_withFlexibleGpuLink_basic "$(CURDIR)/scripts/local-test.sh" TestAccVM_UpdateKeypair + "$(CURDIR)/scripts/local-test.sh" TestAccVM_UpdateTags "$(CURDIR)/scripts/local-test.sh" TestAccVM_UpdateDeletionProtection "$(CURDIR)/scripts/local-test.sh" TestAccVM_multiBlockDeviceMapping + "$(CURDIR)/scripts/local-test.sh" TestAccVM_WithTagDataSource + "$(CURDIR)/scripts/local-test.sh" TestAccVM_withImageExportTask_basic + "$(CURDIR)/scripts/local-test.sh" TestAccVM_WithImageDataSource_basic + "$(CURDIR)/scripts/local-test.sh" TestAccVM_withImageExportTasksDataSource_basic "$(CURDIR)/scripts/local-test.sh" TestAccOthers_DataSourceFlexibleGpu_basic "$(CURDIR)/scripts/local-test.sh" TestAccOthers_Volume_io1Type "$(CURDIR)/scripts/local-test.sh" TestAccOthers_LBU_basic + "$(CURDIR)/scripts/local-test.sh" TestAccOthers_DataSourceAccount_basic + "$(CURDIR)/scripts/local-test.sh" TestAccOthers_ClientGatewaysDatasource_withFilters .PHONY: terraform-examples terraform-examples: From ca12cbafce0ff06dcb10d1a0d164512bb0fedb82 Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Thu, 31 Oct 2024 17:09:16 +0100 Subject: [PATCH 5/6] update ricochet-2 for CI Signed-off-by: Matthias Gatto --- .github/workflows/others_testacc.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/others_testacc.yml b/.github/workflows/others_testacc.yml index 6e0ca8a7d..f399ad687 100644 --- a/.github/workflows/others_testacc.yml +++ b/.github/workflows/others_testacc.yml @@ -36,8 +36,8 @@ jobs: go-version: 'stable' - name: local tests run: | - wget https://github.com/outscale/osc-ricochet-2/releases/download/v0.2.0/osc-ricochet-2_v0.2.0_x86_64-unknown-linux-musl.tar.gz - tar -xvf osc-ricochet-2_v0.2.0_x86_64-unknown-linux-musl.tar.gz + wget https://github.com/outscale/osc-ricochet-2/releases/download/v0.4.0/osc-ricochet-2_v0.4.0_x86_64-unknown-linux-musl.tar.gz + tar -xvf osc-ricochet-2_v0.4.0_x86_64-unknown-linux-musl.tar.gz ./ricochet-2 ./ricochet.json & make test-locally From ec23ce886ec2fb2cc082b966f7b5bee7eaa15f2c Mon Sep 17 00:00:00 2001 From: Matthias Gatto Date: Thu, 7 Nov 2024 12:02:42 +0100 Subject: [PATCH 6/6] move local tests to it's own CI file Signed-off-by: Matthias Gatto --- .github/workflows/local_testacc.yml | 36 ++++++++++++++++++++++++++++ .github/workflows/others_testacc.yml | 6 ----- 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/local_testacc.yml diff --git a/.github/workflows/local_testacc.yml b/.github/workflows/local_testacc.yml new file mode 100644 index 000000000..b2857a49a --- /dev/null +++ b/.github/workflows/local_testacc.yml @@ -0,0 +1,36 @@ +name: Local Acceptances tests + +on: + pull_request: + branches: + - master + paths: + - '**.go' + - '**.sum' + - '**.mod' + - 'GNUmakefile' + workflow_dispatch: + +jobs: + Local_acceptances_tests: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} + - name: Setup Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: 1.6.5 + terraform_wrapper: false + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + - name: local tests + run: | + wget https://github.com/outscale/osc-ricochet-2/releases/download/v0.4.0/osc-ricochet-2_v0.4.0_x86_64-unknown-linux-musl.tar.gz + tar -xvf osc-ricochet-2_v0.4.0_x86_64-unknown-linux-musl.tar.gz + ./ricochet-2 ./ricochet.json & + make test-locally diff --git a/.github/workflows/others_testacc.yml b/.github/workflows/others_testacc.yml index f399ad687..4e92bd44f 100644 --- a/.github/workflows/others_testacc.yml +++ b/.github/workflows/others_testacc.yml @@ -34,12 +34,6 @@ jobs: uses: actions/setup-go@v5 with: go-version: 'stable' - - name: local tests - run: | - wget https://github.com/outscale/osc-ricochet-2/releases/download/v0.4.0/osc-ricochet-2_v0.4.0_x86_64-unknown-linux-musl.tar.gz - tar -xvf osc-ricochet-2_v0.4.0_x86_64-unknown-linux-musl.tar.gz - ./ricochet-2 ./ricochet.json & - make test-locally - name: Build go test run: make test