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 6e0ca8a7d..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.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 - ./ricochet-2 ./ricochet.json & - make test-locally - name: Build go test run: make test diff --git a/GNUmakefile b/GNUmakefile index 7f149de46..aae3fab31 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -67,8 +67,24 @@ 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_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: 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" {