Skip to content

Commit 6d18a98

Browse files
authored
Merge pull request #32 from turkenh/e2e-collect-logs
E2E - CI improvements and wait for provider gcp before applying providerconfig
2 parents fb5182d + ad9031a commit 6d18a98

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

.github/workflows/e2e.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
github_token: ${{ secrets.GITHUB_TOKEN }}
2525
paths_ignore: '["**.md", "**.png", "**.jpg"]'
26-
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
26+
do_not_skip: '["workflow_dispatch", "schedule", "push", "issue_comment"]'
2727

2828
e2e:
2929
runs-on: ubuntu-22.04
@@ -53,3 +53,22 @@ jobs:
5353
env:
5454
UPTEST_GCP_PROJECT: ${{ secrets.UPTEST_GCP_PROJECT }}
5555
UPTEST_GCP_CREDS: ${{ secrets.UPTEST_GCP_CREDS }}
56+
57+
- name: Collect Control Plane Dump
58+
if: always()
59+
run: |
60+
export CONTROLPLANE_DUMP_DIRECTORY=./_output/controlplane-dump
61+
make controlplane.dump
62+
63+
- name: Upload Control Plane Dump
64+
if: always()
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: cluster-dump-${{ needs.get-example-list.outputs.provider_name }}
68+
path: ./_output/controlplane-dump
69+
70+
- name: Cleanup
71+
if: always()
72+
run: |
73+
eval $(make --no-print-directory build.vars)
74+
${KUBECTL} delete managed --all

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,12 @@ uptest: build $(UPTEST) $(KUBECTL) $(KUTTL) local.xpkg.deploy.configuration.$(PR
5858
@KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/cluster-claim.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL)
5959
@$(OK) running automated tests
6060

61+
#TODO(turkenh): move to build submodule
62+
CONTROLPLANE_DUMP_DIRECTORY ?= $(OUTPUT_DIR)/controlplane-dump
63+
controlplane.dump: $(KUBECTL)
64+
@mkdir -p ${DUMP_DIRECTORY}
65+
@$(KUBECTL) cluster-info dump --output-directory ${DUMP_DIRECTORY} --all-namespaces || true
66+
@$(KUBECTL) get managed -o yaml > ${DUMP_DIRECTORY}/managed.yaml || true
67+
@cat /tmp/automated-tests/case/*.yaml > ${DUMP_DIRECTORY}/kuttl-inputs.yaml
68+
6169
e2e: controlplane.up uptest

test/setup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ echo "Creating cloud credential secret"
1212
${KUBECTL} -n upbound-system create secret generic gcp-creds --from-literal=credentials="${UPTEST_GCP_CREDS}" \
1313
--dry-run=client -o yaml | ${KUBECTL} apply -f -
1414

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

0 commit comments

Comments
 (0)