From 51e25790d98759c7090a930351188fc8b201b969 Mon Sep 17 00:00:00 2001 From: Thiery Ouattara Date: Wed, 11 Oct 2023 07:31:40 +0000 Subject: [PATCH] Enable running integration tests on Mac OS --- scripts/integration.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/integration.sh b/scripts/integration.sh index b4bf91f44..b1d3f03bf 100755 --- a/scripts/integration.sh +++ b/scripts/integration.sh @@ -13,8 +13,24 @@ 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/ -cp terraform-provider-outscale_v0.5.32 $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/linux_amd64/ +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + mkdir -p $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/linux_amd64/ + cp terraform-provider-outscale_v0.5.32 $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/linux_amd64/ +elif [[ "$OSTYPE" == "darwin"* ]]; then + case $(uname -m) in + arm64) + mkdir -p $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/darwin_arm64/ + cp terraform-provider-outscale_v0.5.32 $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/darwin_arm64/ + ;; + *) + mkdir -p $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/darwin_amd64/ + cp terraform-provider-outscale_v0.5.32 $BUILD_DIR/terraform.d/plugins/registry.terraform.io/outscale/outscale/0.5.32/darwin_amd64/ + ;; + esac +else + echo "OS $OSTYPE is not supported yet for testing" + exit 1 +fi cd $BUILD_DIR pip install -r requirements.txt