forked from outscale/terraform-provider-outscale
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80d0d7d
commit 4e93aa4
Showing
7 changed files
with
263 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Nets integration tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- '**.go' | ||
- 'tests/**' | ||
- 'scripts/test_nets_integration.sh' | ||
- 'GNUmakefile' | ||
- '!**_test.go' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Nets_integration_tests: | ||
environment: test-eu-west-2 | ||
runs-on: [self-hosted, linux, eu-west-2] | ||
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: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.5.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.3.5 | ||
terraform_wrapper: false | ||
- name: Run nets integration tests | ||
run: make test-nets-integration | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Others integration tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- '**.go' | ||
- 'tests/**' | ||
- 'scripts/test_others_integration.sh' | ||
- 'GNUmakefile' | ||
- '!**_test.go' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Others_integration_tests: | ||
environment: test-eu-west-2 | ||
runs-on: [self-hosted, linux, eu-west-2] | ||
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: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.5.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.3.5 | ||
terraform_wrapper: false | ||
- name: Run others integration tests | ||
run: make test-others-integration | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Vms integration tests | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- '**.go' | ||
- 'tests/**' | ||
- 'scripts/test_vms_integration.sh' | ||
- 'GNUmakefile' | ||
- '!**_test.go' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Vms_integration_tests: | ||
environment: test-eu-west-2 | ||
runs-on: [self-hosted, linux, eu-west-2] | ||
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: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.5.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Setup Terraform | ||
uses: hashicorp/setup-terraform@v2 | ||
with: | ||
terraform_version: 1.3.5 | ||
terraform_wrapper: false | ||
- name: Run vms integration tests | ||
run: make test-vms-integration | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
project_dir=$(cd "$(dirname $0)" && pwd) | ||
project_root=$(cd $project_dir/.. && pwd) | ||
BUILD_DIR=$project_root/tests/qa_provider_oapi | ||
|
||
python3 --version || (echo "We need 'python3' intalled to run integration tests"; exit 1) | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
pip --version || (echo "We need 'pip' intalled to run integration tests"; exit 1) | ||
|
||
make fmt | ||
make test | ||
go build -o terraform-provider-outscale_v0.5.32 | ||
mkdir -p $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/linux_amd64/ | ||
mv terraform-provider-outscale_v0.5.32 $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/linux_amd64/ | ||
|
||
cd $BUILD_DIR | ||
git grep '"outscale_net"' data/ | awk -F/ '{ print $3 }' | awk -F_ '{ print $1 }' | sort | uniq > listNets | ||
|
||
pip install -r requirements.txt | ||
while read line; do | ||
pytest -k $line -v ./test_provider_oapi.py | ||
done < listNets | ||
|
||
rm -fr terraform.d listNets || exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
project_dir=$(cd "$(dirname $0)" && pwd) | ||
project_root=$(cd $project_dir/.. && pwd) | ||
BUILD_DIR=$project_root/tests/qa_provider_oapi | ||
|
||
python3 --version || (echo "We need 'python3' intalled to run integration tests"; exit 1) | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
pip --version || (echo "We need 'pip' intalled to run integration tests"; exit 1) | ||
|
||
make fmt | ||
make test | ||
go build -o terraform-provider-outscale_v0.5.32 | ||
mkdir -p $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/linux_amd64/ | ||
mv terraform-provider-outscale_v0.5.32 $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/linux_amd64/ | ||
|
||
cd $BUILD_DIR | ||
git grep '"outscale_vm"' data/ | awk -F/ '{ print $3 }' | awk -F_ '{ print $1 }' | sort | uniq > listVms | ||
sed -r -i '/TF-(109|111|113|144|145|65)/d' listVms | ||
git grep '"outscale_net"' data/ | awk -F/ '{ print $3 }' | awk -F_ '{ print $1 }' | sort | uniq > listNets | ||
git grep 'resource "' data/ | awk -F/ '{ print $3 }' | awk -F_ '{ print $1 }' | sort | uniq > listOthres | ||
git grep 'data "' data/ | awk -F/ '{ print $3 }' | awk -F_ '{ print $1 }' | sort | uniq >> listOthres | ||
|
||
while read line; do | ||
sed -i "/$line/d" listOthres | ||
done < listVms | ||
|
||
while read line; do | ||
sed -i "/$line/d" listOthres | ||
done < listNets | ||
|
||
pip install -r requirements.txt | ||
while read line; do | ||
pytest -k $line -v ./test_provider_oapi.py | ||
done < listOthres | ||
|
||
rm -fr terraform.d listVms listNets listOthres || exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
project_dir=$(cd "$(dirname $0)" && pwd) | ||
project_root=$(cd $project_dir/.. && pwd) | ||
BUILD_DIR=$project_root/tests/qa_provider_oapi | ||
|
||
python3 --version || (echo "We need 'python3' intalled to run integration tests"; exit 1) | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
pip --version || (echo "We need 'pip' intalled to run integration tests"; exit 1) | ||
|
||
make fmt | ||
make test | ||
go build -o terraform-provider-outscale_v0.5.32 | ||
mkdir -p $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/linux_amd64/ | ||
mv terraform-provider-outscale_v0.5.32 $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/linux_amd64/ | ||
|
||
cd $BUILD_DIR | ||
|
||
git grep '"outscale_vm"' data/ | awk -F/ '{ print $3 }' | awk -F_ '{ print $1 }' | sort | uniq > listVms | ||
sed -r -i '/TF-(109|111|113|144|145|65)/d' listVms | ||
|
||
pip install -r requirements.txt | ||
while read line; do | ||
pytest -k $line -v ./test_provider_oapi.py | ||
done < listVms | ||
|
||
rm -fr terraform.d listVms || exit 0 |