2024-03-02 14:36:38 -07:00
|
|
|
name: Integration Tests
|
|
|
|
on: [pull_request]
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
|
|
integration-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
test:
|
|
|
|
- TestACLHostsInNetMapTable
|
|
|
|
- TestACLAllowUser80Dst
|
|
|
|
- TestACLDenyAllPort80
|
|
|
|
- TestACLAllowUserDst
|
|
|
|
- TestACLAllowStarDst
|
|
|
|
- TestACLNamedHostsCanReachBySubnet
|
|
|
|
- TestACLNamedHostsCanReach
|
|
|
|
- TestACLDevice1CanAccessDevice2
|
2024-07-17 23:38:25 -06:00
|
|
|
- TestPolicyUpdateWhileRunningWithCLIInDatabase
|
2024-03-02 14:36:38 -07:00
|
|
|
- TestOIDCAuthenticationPingAll
|
|
|
|
- TestOIDCExpireNodesBasedOnTokenExpiry
|
|
|
|
- TestAuthWebFlowAuthenticationPingAll
|
|
|
|
- TestAuthWebFlowLogoutAndRelogin
|
|
|
|
- TestUserCommand
|
|
|
|
- TestPreAuthKeyCommand
|
|
|
|
- TestPreAuthKeyCommandWithoutExpiry
|
|
|
|
- TestPreAuthKeyCommandReusableEphemeral
|
2024-05-02 03:53:16 -06:00
|
|
|
- TestPreAuthKeyCorrectUserLoggedInCommand
|
2024-03-02 14:36:38 -07:00
|
|
|
- TestApiKeyCommand
|
|
|
|
- TestNodeTagCommand
|
|
|
|
- TestNodeAdvertiseTagNoACLCommand
|
|
|
|
- TestNodeAdvertiseTagWithACLCommand
|
|
|
|
- TestNodeCommand
|
|
|
|
- TestNodeExpireCommand
|
|
|
|
- TestNodeRenameCommand
|
|
|
|
- TestNodeMoveCommand
|
2024-07-17 23:38:25 -06:00
|
|
|
- TestPolicyCommand
|
2024-03-02 14:36:38 -07:00
|
|
|
- TestDERPServerScenario
|
|
|
|
- TestPingAllByIP
|
|
|
|
- TestPingAllByIPPublicDERP
|
|
|
|
- TestAuthKeyLogoutAndRelogin
|
|
|
|
- TestEphemeral
|
2024-07-18 02:01:59 -06:00
|
|
|
- TestEphemeral2006DeletedTooQuickly
|
2024-03-02 14:36:38 -07:00
|
|
|
- TestPingAllByHostname
|
|
|
|
- TestTaildrop
|
|
|
|
- TestResolveMagicDNS
|
|
|
|
- TestExpireNode
|
2024-02-23 02:59:24 -07:00
|
|
|
- TestNodeOnlineStatus
|
|
|
|
- TestPingAllByIPManyUpDown
|
2024-03-02 14:36:38 -07:00
|
|
|
- TestEnablingRoutes
|
|
|
|
- TestHASubnetRouterFailover
|
|
|
|
- TestEnableDisableAutoApprovedRoute
|
|
|
|
- TestSubnetRouteACL
|
|
|
|
- TestHeadscale
|
|
|
|
- TestCreateTailscale
|
|
|
|
- TestTailscaleNodesJoiningHeadcale
|
|
|
|
- TestSSHOneUserToAll
|
|
|
|
- TestSSHMultipleUsersAllToAll
|
|
|
|
- TestSSHNoSSHConfigured
|
|
|
|
- TestSSHIsBlockedInACL
|
|
|
|
- TestSSHUserOnlyIsolation
|
|
|
|
database: [postgres, sqlite]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 2
|
2024-03-13 06:43:06 -06:00
|
|
|
- name: Get changed files
|
|
|
|
id: changed-files
|
|
|
|
uses: dorny/paths-filter@v3
|
|
|
|
with:
|
|
|
|
filters: |
|
|
|
|
files:
|
|
|
|
- '*.nix'
|
|
|
|
- 'go.*'
|
|
|
|
- '**/*.go'
|
|
|
|
- 'integration_test/'
|
|
|
|
- 'config-example.yaml'
|
2024-03-02 14:36:38 -07:00
|
|
|
- uses: DeterminateSystems/nix-installer-action@main
|
2024-03-13 06:43:06 -06:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-03-02 14:36:38 -07:00
|
|
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
2024-03-13 06:43:06 -06:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-03-02 14:36:38 -07:00
|
|
|
- uses: satackey/action-docker-layer-caching@main
|
2024-03-13 06:43:06 -06:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-03-02 14:36:38 -07:00
|
|
|
continue-on-error: true
|
|
|
|
- name: Run Integration Test
|
|
|
|
uses: Wandalen/wretry.action@master
|
2024-03-13 06:43:06 -06:00
|
|
|
if: steps.changed-files.outputs.files == 'true'
|
2024-03-02 14:36:38 -07:00
|
|
|
env:
|
|
|
|
USE_POSTGRES: ${{ matrix.database == 'postgres' && '1' || '0' }}
|
|
|
|
with:
|
|
|
|
attempt_limit: 5
|
|
|
|
command: |
|
|
|
|
nix develop --command -- docker run \
|
|
|
|
--tty --rm \
|
|
|
|
--volume ~/.cache/hs-integration-go:/go \
|
|
|
|
--name headscale-test-suite \
|
|
|
|
--volume $PWD:$PWD -w $PWD/integration \
|
|
|
|
--volume /var/run/docker.sock:/var/run/docker.sock \
|
|
|
|
--volume $PWD/control_logs:/tmp/control \
|
|
|
|
--env HEADSCALE_INTEGRATION_POSTGRES=${{env.USE_POSTGRES}} \
|
|
|
|
golang:1 \
|
|
|
|
go run gotest.tools/gotestsum@latest -- ./... \
|
|
|
|
-failfast \
|
|
|
|
-timeout 120m \
|
|
|
|
-parallel 1 \
|
|
|
|
-run "^${{ matrix.test }}$"
|
|
|
|
- uses: actions/upload-artifact@v4
|
2024-03-13 06:43:06 -06:00
|
|
|
if: always() && steps.changed-files.outputs.files == 'true'
|
2024-03-02 14:36:38 -07:00
|
|
|
with:
|
|
|
|
name: ${{ matrix.test }}-${{matrix.database}}-logs
|
|
|
|
path: "control_logs/*.log"
|
|
|
|
- uses: actions/upload-artifact@v4
|
2024-03-13 06:43:06 -06:00
|
|
|
if: always() && steps.changed-files.outputs.files == 'true'
|
2024-03-02 14:36:38 -07:00
|
|
|
with:
|
|
|
|
name: ${{ matrix.test }}-${{matrix.database}}-pprof
|
|
|
|
path: "control_logs/*.pprof.tar"
|