Skip to content

Commit

Permalink
Merge pull request #32 from turkenh/e2e-collect-logs
Browse files Browse the repository at this point in the history
E2E - CI improvements and wait for provider gcp before applying providerconfig
  • Loading branch information
turkenh committed Oct 14, 2022
2 parents fb5182d + ad9031a commit 6d18a98
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
do_not_skip: '["workflow_dispatch", "schedule", "push", "issue_comment"]'

e2e:
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -53,3 +53,22 @@ jobs:
env:
UPTEST_GCP_PROJECT: ${{ secrets.UPTEST_GCP_PROJECT }}
UPTEST_GCP_CREDS: ${{ secrets.UPTEST_GCP_CREDS }}

- name: Collect Control Plane Dump
if: always()
run: |
export CONTROLPLANE_DUMP_DIRECTORY=./_output/controlplane-dump
make controlplane.dump
- name: Upload Control Plane Dump
if: always()
uses: actions/upload-artifact@v3
with:
name: cluster-dump-${{ needs.get-example-list.outputs.provider_name }}
path: ./_output/controlplane-dump

- name: Cleanup
if: always()
run: |
eval $(make --no-print-directory build.vars)
${KUBECTL} delete managed --all
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,12 @@ uptest: build $(UPTEST) $(KUBECTL) $(KUTTL) local.xpkg.deploy.configuration.$(PR
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/cluster-claim.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL)
@$(OK) running automated tests

#TODO(turkenh): move to build submodule
CONTROLPLANE_DUMP_DIRECTORY ?= $(OUTPUT_DIR)/controlplane-dump
controlplane.dump: $(KUBECTL)
@mkdir -p ${DUMP_DIRECTORY}
@$(KUBECTL) cluster-info dump --output-directory ${DUMP_DIRECTORY} --all-namespaces || true
@$(KUBECTL) get managed -o yaml > ${DUMP_DIRECTORY}/managed.yaml || true
@cat /tmp/automated-tests/case/*.yaml > ${DUMP_DIRECTORY}/kuttl-inputs.yaml

e2e: controlplane.up uptest
1 change: 1 addition & 0 deletions test/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ echo "Creating cloud credential secret"
${KUBECTL} -n upbound-system create secret generic gcp-creds --from-literal=credentials="${UPTEST_GCP_CREDS}" \
--dry-run=client -o yaml | ${KUBECTL} apply -f -

${KUBECTL} wait crd providerconfigs.gcp.upbound.io --for=condition=established
echo "Creating a default provider config"
cat <<EOF | ${KUBECTL} apply -f -
apiVersion: gcp.upbound.io/v1beta1
Expand Down

0 comments on commit 6d18a98

Please sign in to comment.