Skip to content

Commit

Permalink
fixup! fixup! test devbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
elchead committed Jan 3, 2024
1 parent 9c7be95 commit 13e679e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
44 changes: 18 additions & 26 deletions .github/workflows/e2e-test-provider-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,23 @@ jobs:
nixTools: terraform

- name: Build Constellation provider # CLI is needed for the upgrade assert and container push is needed for the microservice upgrade
working-directory: ${{ github.workspace }}
id: build
shell: bash
run: |
mkdir build
cd build
bazel run //:devbuild --cli_edition=enterprise
- name: Remove local Terraform registry
if: inputs.providerVersion == ''
bazel build //bazel/settings:tag
repository_root=$(git rev-parse --show-toplevel)
out_rel=$(bazel cquery --output=files //bazel/settings:tag)
build_version=$(cat "$(realpath "${repository_root}/${out_rel}")")
echo "build_version=${build_version}" | tee -a "$GITHUB_OUTPUT"
- name: Remove local Terraform registry # otherwise the local registry would be used instead of the public registry
if: inputs.providerVersion != ''
shell: bash
run: |
bazel build //bazel/settings:tag
Expand All @@ -137,7 +146,6 @@ jobs:
# remove local registry if it was used and public registry should be used now
rm -rf "${terraform_provider_dir}"
echo "build_version=${build_version}" | tee -a "$GITHUB_OUTPUT"
- name: Login to AWS (IAM + Cluster role)
if: inputs.cloudProvider == 'aws'
Expand Down Expand Up @@ -167,7 +175,7 @@ jobs:
mkdir cluster
cd cluster
if [[ "${{ inputs.providerVersion }}" == "" ]]; then
prefixed_version=${{ steps.install_tf_provider.outputs.build_version }}
prefixed_version=${{ steps.build.outputs.build_version }}
else
prefixed_version="${{ inputs.providerVersion }}"
fi
Expand Down Expand Up @@ -287,28 +295,12 @@ jobs:
terraform init
terraform destroy -auto-approve
- name: Remove or add to local Terraform registry
- name: Build Constellation provider # add local registry if release version was used before
if: inputs.providerVersion != ''
working-directory: ${{ github.workspace }}/build
shell: bash
id: upgrade_tf_provider
run: |
bazel build //bazel/settings:tag
repository_root=$(git rev-parse --show-toplevel)
out_rel=$(bazel cquery --output=files //bazel/settings:tag)
build_version=$(cat "$(realpath "${repository_root}/${out_rel}")")
terraform_provider_dir="${HOME}/.terraform.d/plugins/registry.terraform.io/edgelesssys/constellation/${build_version#v}/linux_amd64/"
# remove local registry if it was used and public registry should be used now
if [[ "${{ inputs.providerVersion }}" == "" ]]; then
rm -rf "${terraform_provider_dir}"
fi
# add to local registry if it was not used and local registry should be used now
if [[ "${{ inputs.providerVersion }}" != "" ]]; then
mkdir -p "${terraform_provider_dir}"
mv build/terraform-provider-constellation "${terraform_provider_dir}/terraform-provider-constellation_${build_version}"
fi
echo "build_version=${build_version}" | tee -a "$GITHUB_OUTPUT"
bazel run //:devbuild --cli_edition=enterprise
- name: Update cluster configuration # for duplicate variable declaration, the last one is used
working-directory: ${{ github.workspace }}/cluster
Expand All @@ -330,7 +322,7 @@ jobs:
EOF
fi
prefixed_version=${{ steps.upgrade_tf_provider.outputs.build_version }}
prefixed_version=${{ steps.build.outputs.build_version }}
version=${prefixed_version#v} # remove v prefix
# needs to be explicitly set to upgrade
Expand Down Expand Up @@ -364,7 +356,7 @@ jobs:
env:
IMAGE: ${{ inputs.toImage && inputs.toImage || steps.find-latest-image.outputs.image }}
KUBERNETES: ${{ inputs.toKubernetes }}
MICROSERVICES: ${{ steps.find-latest-image.outputs.image }}
MICROSERVICES: ${{ steps.build.outputs.build_version }}
WORKERNODES: 1
CONTROLNODES: 1
run: |
Expand Down
2 changes: 1 addition & 1 deletion e2e/provider-upgrade/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var (
cliPath = flag.String("cli", "", "Constellation CLI to run the tests.")
wantWorker = flag.Int("want-worker", 0, "Number of wanted worker nodes.")
wantControl = flag.Int("want-control", 0, "Number of wanted control nodes.")
timeout = flag.Duration("timeout", 3*time.Hour, "Timeout after which the cluster should have converged to the target version.")
timeout = flag.Duration("timeout", 90*time.Minute, "Timeout after which the cluster should have converged to the target version.")
)

// TestUpgradeSuccessful tests that the upgrade to the target version is successful.
Expand Down

0 comments on commit 13e679e

Please sign in to comment.