Skip to content

Commit

Permalink
split tests in workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rawdaGastan committed Aug 13, 2024
1 parent 35f7991 commit 4ac0de3
Showing 1 changed file with 33 additions and 84 deletions.
117 changes: 33 additions & 84 deletions .github/workflows/terratest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ on:
- "v*"

jobs:
go-tests:
name: Run Go Tests
init:
name: Preparing
runs-on: ubuntu-latest
timeout-minutes: 0
strategy:
fail-fast: false
matrix:
network: ["dev", "qa", "test", "main"]
steps:
- uses: actions/setup-go@v5
with:
Expand All @@ -41,7 +39,7 @@ jobs:
PEERS=$(curl https://raw.githubusercontent.com/AhmedHanafy725/yggdrasil-config/main/config.json | jq '.yggdrasil.peers[]' -r | sed 's/\//\\\//g' | sed -z 's/\n/\\n/g')
sudo sed -i -- 's/Peers\: \[\]/Peers: [\n'"$PEERS"']/g' /etc/yggdrasil/yggdrasil.conf
sudo systemctl restart yggdrasil
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
Expand All @@ -50,89 +48,40 @@ jobs:
mkdir -p ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
go build -o terraform-provider-grid
mv terraform-provider-grid ~/.terraform.d/plugins/threefoldtechdev.com/providers/grid/0.2/linux_amd64/
- name: Test virtual machines
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestVM

- name: Test kubernetes
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: |
go test -v ./... --tags=integration -run TestK8s
go test -v ./... --tags=integration -run TestModuleK8s
- name: Test Gateways
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestGatewayDeployments
- name: Test private gateways
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestGatewayPrivate

- name: Test wireguard
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestWireguard

- name: Test ZDBs
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestZdbs

- name: Test QSFS
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestQSFS

- name: Test peertube
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestPeertube

- name: Test presearch
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestPresearch

- name: Test taiga
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestTaiga
go-tests:
needs: init
name: Testing ${{ matrix.network }} ${{ matrix.tests.name }}
runs-on: ubuntu-latest
timeout-minutes: 0
strategy:
fail-fast: false
max-parallel: 1
matrix:
# network: ["dev", "qa", "test", "main"]
network: ["dev"]
tests: [{name: "vm", test: "go test -v ./... --tags=integration -run TestVM"},
{name: "k8s", test: "go test -v ./... --tags=integration -run TestK8s"},
{name: "k8s-module", test: "go test -v ./... --tags=integration -run TestModuleK8s"},
{name: "gateway", test: "go test -v ./... --tags=integration -run TestGatewayDeployments"},
{name: "gateway-private", test: "go test -v ./... --tags=integration -run TestGatewayPrivate"},
{name: "wireguard", test: "go test -v ./... --tags=integration -run TestWireguard"},
{name: "zdb", test: "go test -v ./... --tags=integration -run TestZdbs"},
{name: "qsfs", test: "go test -v ./... --tags=integration -run TestQSFS"},
{name: "peertube", test: "go test -v ./... --tags=integration -run TestPeertube"},
{name: "presearch", test: "go test -v ./... --tags=integration -run TestPresearch"},
{name: "taiga", test: "go test -v ./... --tags=integration -run TestTaiga"},
{name: "mattermost", test: "go test -v ./... --tags=integration -run TestMattermost"},
{name: "nomad", test: "go test -v ./... --tags=integration -run TestNomad"}]

- name: Test mattermost
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestMattermost
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Test nomad
- name: Test ${{ matrix.tests.name }}
env:
MNEMONIC: ${{ secrets.MNEMONICS }}
NETWORK: ${{ matrix.network }}
working-directory: integrationtests
run: go test -v ./... --tags=integration -run TestNomad

run: ${{ matrix.tests.test }}

0 comments on commit 4ac0de3

Please sign in to comment.