This repository has been archived by the owner on Apr 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds workflow dispatch for go-based e2e tests. Also moves the e2e tests into a separate workflow since the "on" clause is now different from other jobs.
- Loading branch information
Showing
3 changed files
with
109 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: End to End | ||
|
||
defaults: | ||
run: | ||
shell: bash --noprofile --norc -eo pipefail {0} | ||
|
||
on: | ||
push: | ||
branches: [master, main, force_test, release-*, staging, trying] | ||
pull_request: | ||
branches: ['**'] | ||
schedule: | ||
- cron: "6 0 * * *" | ||
workflow_dispatch: | ||
inputs: | ||
docker_image_prefix: | ||
description: 'Docker image prefix' | ||
required: true | ||
default: 'ghcr.io/timescale/dev_promscale_extension:develop-ts2' | ||
|
||
env: | ||
golang-version: 1.18.0 | ||
|
||
jobs: | ||
test-end-to-end: | ||
name: e2e | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
test-setups: | ||
- {name: "Singlenode (12)", shortname: "singlenode-12", tsdb: true, multi: false, pg: 12} | ||
- {name: "Singlenode (13)", shortname: "singlenode-13", tsdb: true, multi: false, pg: 13} | ||
- {name: "Singlenode", shortname: "singlenode-14", tsdb: true, multi: false, pg: 14} | ||
- {name: "Without TimescaleDB", shortname: "no-timescaledb", tsdb: false, multi: false, pg: 14} | ||
# TODO (james): Skipping multinode because tests are broken for now | ||
# - {name: "Multinode", shortname: "multinode", tsdb: true, multi: true, pg: 14} | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v3 | ||
|
||
- name: Checkout test data files | ||
run: wget https://github.com/timescale/promscale-test-data/raw/main/traces-dataset.sz -O pkg/tests/testdata/traces-dataset.sz | ||
|
||
- name: Set up Go ${{ env.golang-version }} | ||
uses: actions/setup-go@v3.0.0 | ||
with: | ||
go-version: ${{ env.golang-version }} | ||
id: go | ||
|
||
- name: Use Go module caching | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Figure out database container image from branch name | ||
id: metadata | ||
if: github.event_name != 'workflow_dispatch' | ||
run: | | ||
branch_name=$(echo ${{github.head_ref || github.ref_name}} | sed 's#/#-#') | ||
possible_branch_tag=$(echo ${branch_name}-ts2-pg${{matrix.test-setups.pg}}) | ||
develop_branch_tag=$(echo develop-ts2-pg${{matrix.test-setups.pg}}) | ||
image_base="ghcr.io/timescale/dev_promscale_extension" | ||
docker_image=$(./scripts/fallback-docker.sh ${image_base}:${possible_branch_tag} ${image_base}:${develop_branch_tag}) | ||
echo "::set-output name=docker_image::${docker_image}" | ||
- name: Figure out database container image via workflow input | ||
id: metadata_wd | ||
if: github.event_name == 'workflow_dispatch' | ||
run: | | ||
docker_image=$(echo ${{github.event.inputs.docker_image_prefix}}-pg${{matrix.test-setups.pg}}) | ||
echo "::set-output name=docker_image::${docker_image}" | ||
- name: Test ${{ matrix.test-setups.name }} | ||
env: | ||
DOCKER_IMAGE: ${{ github.event_name == 'workflow_dispatch' && steps.metadata_wd.outputs.docker_image || steps.metadata.outputs.docker_image }} | ||
TSDB: ${{ matrix.test-setups.tsdb }} | ||
MULTI: ${{ matrix.test-setups.multi }} | ||
SHORTNAME: ${{ matrix.test-setups.shortname }} | ||
run: go test -race -timeout=30m ./pkg/tests/end_to_end_tests/ -use-timescaledb=$TSDB -use-multinode=$MULTI -timescale-docker-image=$DOCKER_IMAGE | ||
|
||
# Added to summarize the matrix | ||
tests-result: | ||
name: e2e results | ||
if: always() | ||
needs: | ||
- test-end-to-end | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Mark the job as a success | ||
if: needs.test-end-to-end.result == 'success' | ||
run: exit 0 | ||
- name: Mark the job as a failure | ||
if: needs.test-end-to-end.result != 'success' | ||
run: exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters