Skip to content

Commit

Permalink
add e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
mircea-pavel-anton committed Oct 1, 2024
1 parent 230e4ee commit bd5af05
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/test-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Test E2E

on:
# Manual Trigger
workflow_dispatch: {}

# Run on any PR that changes this pipeline or that should ultimately trigger a release when merged
pull_request:
paths:
- ".github/workflows/test.yaml"
- "go.mod"
- "go.sum"
- "**/**.go"

env:
TALOSCONFIG_DIR: ./configs/
TALSWITCHER_LOG_LEVEL: debug

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Build `talswitcher`
run: go build -o talswitcher

- name: Install `talosctl`
run: curl -sL https://talos.dev/install | sh

- name: Set Up Talos Clusters
run: |
talosctl cluster create --name=test-cluster-1 --talosconfig=./configs/talos1.yaml --cidr=10.5.0.0/24 &
talosctl cluster create --name=test-cluster-2 --talosconfig=./configs/talos2.yaml --cidr=10.6.0.0/24 &
wait
- name: Run talswitcher - switch to cluster 1
run: ./talswitcher test-cluster-1

- name: List Talos Members
run: talosctl get members -n test-cluster-1-controlplane-1

- name: Run talswitcher - switch to cluster 2
run: ./talswitcher test-cluster-2

- name: List Talos Members
run: talosctl get members -n test-cluster-2-controlplane-1

- name: Try to List Members of Cluster 1
run: talosctl get members -n test-cluster-1-controlplane-1 && exit 1 || echo "This was supposed to fail!"

0 comments on commit bd5af05

Please sign in to comment.