Skip to content

Commit 27f0248

Browse files
committed
integration-test for gha
1 parent 27f243e commit 27f0248

File tree

2 files changed

+47
-1
lines changed

2 files changed

+47
-1
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ Does this PR require updates to the documentation at www.gitpod.io/docs?
6161
- [ ] /werft with-large-vm
6262
- [ ] /werft with-gce-vm
6363
If enabled this will create the environment on GCE infra
64-
- [ ] /werft with-integration-tests=all
64+
- [ ] with-integration-tests=all
6565
Valid options are `all`, `workspace`, `webapp`, `ide`, `jetbrains`, `vscode`, `ssh`

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
workspace_feature_flags: ${{ steps.output.outputs.workspace_feature_flags }}
3737
pr_no_diff_skip: ${{ steps.pr-diff.outputs.pr_no_diff_skip }}
3838
with_werft: ${{ steps.output.outputs.with-werft }}
39+
with_integration_tests: ${{ steps.output.outputs.with_integration_tests }}
3940
steps:
4041
- name: "Determine Branch"
4142
id: branches
@@ -66,6 +67,7 @@ jobs:
6667
run: |
6768
{
6869
echo "workspace_feature_flags=$(echo "$PR_DESC" | grep -oP '(?<=\[X\] workspace-feature-flags).*')"
70+
echo "with_integration_tests=$(echo "$PR_DESC" | grep -oiP '(?<=\[x\] with-integration-tests=).*')"
6971
} >> $GITHUB_OUTPUT
7072
7173
build-previewctl:
@@ -281,6 +283,11 @@ jobs:
281283
name: "Install Gitpod"
282284
needs: [ configuration, build-previewctl, build-gitpod, infrastructure ]
283285
runs-on: [ self-hosted ]
286+
container:
287+
image: eu.gcr.io/gitpod-core-dev/dev/dev-environment:kylos101-jam-dev-image.2
288+
volumes:
289+
- /var/tmp:/var/tmp
290+
- /tmp:/tmp
284291
concurrency:
285292
group: ${{ github.head_ref || github.ref_name }}-install
286293
cancel-in-progress: true
@@ -315,3 +322,42 @@ jobs:
315322
with:
316323
sa_key: ${{ secrets.GCP_CREDENTIALS }}
317324
previewctl_hash: ${{ needs.build-previewctl.outputs.previewctl_hash }}
325+
326+
integration-test:
327+
name: "Run integration test"
328+
needs: [ configuration, build-previewctl, build-gitpod, infrastructure, install ]
329+
runs-on: [ self-hosted ]
330+
if: needs.configuration.outputs.with_integration_tests != ''
331+
concurrency:
332+
group: ${{ github.head_ref || github.ref_name }}-integration-test
333+
cancel-in-progress: true
334+
steps:
335+
- uses: actions/checkout@v3
336+
- name: Run integration test
337+
shell: bash
338+
env:
339+
ROBOQUAT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
340+
INTEGRATION_TEST_USERNAME: ${{ secrets.IDE_INTEGRATION_TEST_USERNAME }}
341+
INTEGRATION_TEST_USER_TOKEN: ${{ secrets.IDE_INTEGRATION_TEST_USER_TOKEN }}
342+
PREVIEW_ENV_DEV_SA_KEY: ${{ secrets.GCP_CREDENTIALS }}
343+
PREVIEW_NAME: ${{ github.head_ref || github.ref_name }}
344+
TEST_SUITS: ${{ needs.configuration.outputs.with_integration_tests }}
345+
run: |
346+
set -euo pipefail
347+
348+
export LEEWAY_WORKSPACE_ROOT="$(pwd)"
349+
export HOME="/home/gitpod"
350+
export PREVIEW_ENV_DEV_SA_KEY_PATH="/home/gitpod/.config/gcloud/preview-environment-dev-sa.json"
351+
352+
echo "${PREVIEW_ENV_DEV_SA_KEY}" > "${PREVIEW_ENV_DEV_SA_KEY_PATH}"
353+
gcloud auth activate-service-account --key-file "${PREVIEW_ENV_DEV_SA_KEY_PATH}"
354+
355+
leeway run dev/preview/previewctl:install
356+
357+
echo "Setting up access to core-dev and harvester"
358+
previewctl get-credentials --gcp-service-account "${PREVIEW_ENV_DEV_SA_KEY_PATH}"
359+
360+
previewctl install-context --branch "${PREVIEW_NAME}" --log-level debug --timeout 1m --gcp-service-account "${PREVIEW_ENV_DEV_SA_KEY_PATH}"
361+
362+
$GITHUB_WORKSPACE/test/run.sh -s ${TEST_SUITS}
363+

0 commit comments

Comments
 (0)