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

Run TestAcc on new region #19

Open
wants to merge 5 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
3 changes: 2 additions & 1 deletion .github/workflows/acceptance_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

jobs:
Acceptances_tests:
environment: RUNNER_ACCESS
concurrency: terraform-acceptance-test
runs-on: [self-hosted, linux]
steps:
Expand All @@ -32,7 +33,7 @@ jobs:
- name: Build go test
run: make test
- name: Run acceptance tests
run: make testacc
run: make test-net
env:
OUTSCALE_ACCESSKEYID: ${{ secrets.OSC_ACCESS_KEY }}
OUTSCALE_SECRETKEYID: ${{ secrets.OSC_SECRET_KEY }}
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/net_testacc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Net Acceptances tests

on:
pull_request_target:
branches:
- master
paths:
- '**.go'
- '**.sum'
- '**.mod'
- 'GNUmakefile'
workflow_dispatch:

jobs:
Acceptances_tests:
environment: RUNNER_ACCESS
concurrency: terraform-acceptance-test
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: outscale-dev/frieza-github-actions/frieza-clean@master
with:
access_key: ${{ secrets.OSC_ACCESS_KEY }}
secret_key: ${{ secrets.OSC_SECRET_KEY }}
region: ${{ secrets.OSC_REGION }}
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.18.0'
- name: Build go test
run: make test
- name: Run net acceptance tests
run: make test-net
env:
OUTSCALE_ACCESSKEYID: ${{ secrets.OSC_ACCESS_KEY }}
OUTSCALE_SECRETKEYID: ${{ secrets.OSC_SECRET_KEY }}
OUTSCALE_REGION: ${{ secrets.OSC_REGION }}
OUTSCALE_ACCOUNT: ${{ secrets.OSC_ACCOUNT_ID }}
OUTSCALE_IMAGEID: ${{ secrets.OUTSCALE_IMAGEID }}
42 changes: 42 additions & 0 deletions .github/workflows/run_others_testacc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Others Acceptances tests

on:
pull_request_target:
branches:
- master
paths:
- '**.go'
- '**.sum'
- '**.mod'
- 'GNUmakefile'
workflow_dispatch:

jobs:
Others_acceptances_tests:
environment: RUNNER_ACCESS
concurrency: terraform-acceptance-test
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: outscale-dev/frieza-github-actions/frieza-clean@master
with:
access_key: ${{ secrets.OSC_ACCESS_KEY }}
secret_key: ${{ secrets.OSC_SECRET_KEY }}
region: ${{ secrets.OSC_REGION }}
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.18.0'
- name: Build go test
run: make test
- name: Run others acceptance tests
run: make test-others
env:
OUTSCALE_ACCESSKEYID: ${{ secrets.OSC_ACCESS_KEY }}
OUTSCALE_SECRETKEYID: ${{ secrets.OSC_SECRET_KEY }}
OUTSCALE_REGION: ${{ secrets.OSC_REGION }}
OUTSCALE_ACCOUNT: ${{ secrets.OSC_ACCOUNT_ID }}
OUTSCALE_IMAGEID: ${{ secrets.OUTSCALE_IMAGEID }}
42 changes: 42 additions & 0 deletions .github/workflows/run_vm_testacc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: vm Acceptances tests

on:
pull_request_target:
branches:
- master
paths:
- '**.go'
- '**.sum'
- '**.mod'
- 'GNUmakefile'
workflow_dispatch:

jobs:
Vm_Acceptances_tests:
environment: RUNNER_ACCESS
concurrency: terraform-acceptance-test
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: outscale-dev/frieza-github-actions/frieza-clean@master
with:
access_key: ${{ secrets.OSC_ACCESS_KEY }}
secret_key: ${{ secrets.OSC_SECRET_KEY }}
region: ${{ secrets.OSC_REGION }}
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.18.0'
- name: Build go test
run: make test
- name: Run vm acceptance tests
run: make test-vm
env:
OUTSCALE_ACCESSKEYID: ${{ secrets.OSC_ACCESS_KEY }}
OUTSCALE_SECRETKEYID: ${{ secrets.OSC_SECRET_KEY }}
OUTSCALE_REGION: ${{ secrets.OSC_REGION }}
OUTSCALE_ACCOUNT: ${{ secrets.OSC_ACCOUNT_ID }}
OUTSCALE_IMAGEID: ${{ secrets.OUTSCALE_IMAGEID }}
12 changes: 12 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ test: fmtcheck
testacc: fmtcheck
TF_ACC=1 go test $(TEST) -count 1 -v -parallel 4 $(TESTARGS) -timeout 240m -cover

.PHONY: test-net
test-net: fmtcheck
TF_ACC=1 go test $(TEST) -run=TestAccNet -count 1 -v -parallel 1 $(TESTARGS) -timeout 240m -cover

.PHONY: test-vm
test-vm: fmtcheck
TF_ACC=1 go test $(TEST) -run=TestAccVM -count 1 -v -parallel 4 $(TESTARGS) -timeout 240m -cover

.PHONY: test-others
test-others: fmtcheck
TF_ACC=1 go test $(TEST) -run=TestAccOthers -count 1 -v -parallel 4 $(TESTARGS) -timeout 240m -cover

.PHONY: fmt
fmt:
gofmt -s -w ./main.go
Expand Down
4 changes: 2 additions & 2 deletions outscale/data_source_outscale_access_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccOutscaleDataSourceAccessKey_basic(t *testing.T) {
func TestAccOthers_DatasourceAccessKey_basic(t *testing.T) {
t.Parallel()
dataSourceName := "outscale_access_key.outscale_access_key"

Expand All @@ -28,7 +28,7 @@ func TestAccOutscaleDataSourceAccessKey_basic(t *testing.T) {
})
}

func TestAccOutscaleDataSourceAccessKey_withFilters(t *testing.T) {
func TestAccOthers_AccessKey_withFilters(t *testing.T) {
t.Parallel()
dataSourceName := "outscale_access_key.outscale_access_key"

Expand Down
8 changes: 4 additions & 4 deletions outscale/data_source_outscale_access_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccOutscaleDataSourceAccessKeys_basic(t *testing.T) {
func TestAccOthers_DataSourceAccessKeys_basic(t *testing.T) {
t.Parallel()
dataSourceName := "data.outscale_access_keys.outscale_access_key"

Expand All @@ -25,7 +25,7 @@ func TestAccOutscaleDataSourceAccessKeys_basic(t *testing.T) {
})
}

func TestAccOutscaleDataSourceAccessKeys_withFilters(t *testing.T) {
func TestAccOthers_DataSourceAccessKeys_withFilters(t *testing.T) {
t.Parallel()
dataSourceName := "data.outscale_access_keys.outscale_access_key"

Expand All @@ -49,7 +49,7 @@ func testAccClientAccessKeysDataSourceBasic() string {
resource "outscale_access_key" "outscale_access_key" {}

data "outscale_access_keys" "outscale_access_key" {
access_key_ids = ["${outscale_access_key.outscale_access_key.id}"]
access_key_ids = [outscale_access_key.outscale_access_key.id]
}
`
}
Expand All @@ -61,7 +61,7 @@ func testAccClientAccessKeysDataSourceWithFilters() string {
data "outscale_access_keys" "outscale_access_key" {
filter {
name = "access_key_ids"
values = ["${outscale_access_key.outscale_access_key.id}"]
values = [outscale_access_key.outscale_access_key.id]
}
}
`
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccDataSourceAccount_basic(t *testing.T) {
func TestAccOthers_DataSourceAccount_basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() {
Expand Down
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccDataSourceAccounts_basic(t *testing.T) {
func TestAccOthers_DataSourceAccounts_basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() {
Expand Down
6 changes: 3 additions & 3 deletions outscale/data_source_outscale_api_access_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/terraform"
)

func TestAccDataOutscaleOAPIApiAccessRule_basic(t *testing.T) {
func TestAccOthers_DataOutscaleOAPIApiAccessRule_basic(t *testing.T) {
t.Parallel()
resourceName := "outscale_api_access_rule.rule_data"

Expand Down Expand Up @@ -78,15 +78,15 @@ resource "outscale_ca" "ca_rule" {
}

resource "outscale_api_access_rule" "rule_data" {
ca_ids = ["${outscale_ca.ca_rule.id}"]
ca_ids = [outscale_ca.ca_rule.id]
ip_ranges = ["192.4.2.32/16"]
description = "test api access rule"
}

data "outscale_api_access_rule" "api_access_rule" {
filter {
name = "api_access_rule_ids"
values = ["${outscale_api_access_rule.rule_data.id}"]
values = [outscale_api_access_rule.rule_data.id]
}

filter {
Expand Down
12 changes: 6 additions & 6 deletions outscale/data_source_outscale_ca_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

func TestAccDataOutscaleOAPICa_basic(t *testing.T) {
func TestAccOthers_DataOutscaleCa_basic(t *testing.T) {
resourceName := "outscale_ca.ca_test"

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -72,16 +72,16 @@ func testAccDataCheckOutscaleCaDestroy(s *terraform.State) error {

func testAccDataOutscaleOAPICaConfig(ca_pem string) string {
return fmt.Sprintf(`
resource "outscale_ca" "ca_test" {
resource "outscale_ca" "ca_test" {
ca_pem = %[1]q
description = "Ca testacc create"
}

data "outscale_ca" "ca_data" {
filter {
name = "ca_ids"
values = ["${outscale_ca.ca_test.id}"]
}
filter {
name = "ca_ids"
values = [outscale_ca.ca_test.id]
}
}
`, ca_pem)
}
24 changes: 16 additions & 8 deletions outscale/data_source_outscale_cas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

func TestAccDataOutscaleOAPICas_basic(t *testing.T) {
func TestAccOthers_DataOutscaleCas_basic(t *testing.T) {
resName := "outscale_ca.ca_test"

resource.Test(t, resource.TestCase{
Expand Down Expand Up @@ -72,17 +72,25 @@ func testAccDataCheckOutscaleCasDestroy(s *terraform.State) error {

func testAccDataOutscaleOAPICasConfig(ca_pem string) string {
return fmt.Sprintf(`
resource "outscale_ca" "ca_test" {
resource "outscale_ca" "ca_test" {
ca_pem = %[1]q
description = "Ca testacc create"
}

data "outscale_cas" "cas_data" {
filter {
name = "ca_ids"
values = ["${outscale_ca.ca_test.id}"]
}
resource "outscale_ca" "ca_test2" {
ca_pem = %[1]q
description = "Ca testacc create2"
}

data "outscale_cas" "cas_data" {
filter {
name = "ca_ids"
values = [outscale_ca.ca_test.id]
}
filter {
name = "description"
values = ["Ca testacc create2"]
}
}
data "outscale_cas" "all_cas" {}
`, ca_pem)
}
10 changes: 5 additions & 5 deletions outscale/data_source_outscale_client_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/terraform-providers/terraform-provider-outscale/utils"
)

func TestAccOutscaleGatewayDatasource_basic(t *testing.T) {
func TestAccOthers_GatewayDatasource_basic(t *testing.T) {
t.Parallel()
rBgpAsn := utils.RandIntRange(64512, 65534)
value := fmt.Sprintf("testacc-%s", acctest.RandString(5))
Expand All @@ -25,7 +25,7 @@ func TestAccOutscaleGatewayDatasource_basic(t *testing.T) {
})
}

func TestAccOutscaleGatewayDatasource_withFilters(t *testing.T) {
func TestAccOthers_GatewayDatasource_withFilters(t *testing.T) {
t.Parallel()
// datasourceName := "data.outscale_client_gateway.test"
rBgpAsn := utils.RandIntRange(64512, 65534)
Expand All @@ -42,7 +42,7 @@ func TestAccOutscaleGatewayDatasource_withFilters(t *testing.T) {
})
}

func TestAccOutscaleGatewayDatasource_withFiltersNoLocalhost(t *testing.T) {
func TestAccOthers_GatewayDatasource_withFiltersNoLocalhost(t *testing.T) {
t.Parallel()
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand All @@ -69,7 +69,7 @@ func testAccClientGatewayDatasourceBasic(rBgpAsn int, value string) string {
}

data "outscale_client_gateway" "test" {
client_gateway_id = "${outscale_client_gateway.foo.id}"
client_gateway_id = outscale_client_gateway.foo.id
}
`, rBgpAsn, value)
}
Expand All @@ -90,7 +90,7 @@ func testAccClientGatewayDatasourceWithFilters(rBgpAsn int, value string) string
data "outscale_client_gateway" "test" {
filter {
name = "client_gateway_ids"
values = ["${outscale_client_gateway.foo.id}"]
values = [outscale_client_gateway.foo.id]
}
}
`, rBgpAsn, value)
Expand Down
Loading