Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more tests using ricochet-2 #483

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/local_testacc.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 0 additions & 6 deletions .github/workflows/others_testacc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 17 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 11 additions & 0 deletions outscale/data_source_outscale_image_export_tasks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
Loading