From faf5861c6e0b8bb3368be124384a9e2b26ee0092 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Thu, 15 Feb 2024 16:06:34 +0100 Subject: [PATCH] generate postgres gh action jobsf Signed-off-by: Kristoffer Dalby --- ...ation-v2-TestACLAllowStarDst-postgres.yaml | 68 +++++++++++++++++++ ...st-integration-v2-TestACLAllowStarDst.yaml | 1 + ...ion-v2-TestACLAllowUser80Dst-postgres.yaml | 68 +++++++++++++++++++ ...-integration-v2-TestACLAllowUser80Dst.yaml | 1 + ...ation-v2-TestACLAllowUserDst-postgres.yaml | 68 +++++++++++++++++++ ...st-integration-v2-TestACLAllowUserDst.yaml | 1 + ...tion-v2-TestACLDenyAllPort80-postgres.yaml | 68 +++++++++++++++++++ ...t-integration-v2-TestACLDenyAllPort80.yaml | 1 + ...stACLDevice1CanAccessDevice2-postgres.yaml | 68 +++++++++++++++++++ ...ion-v2-TestACLDevice1CanAccessDevice2.yaml | 1 + ...v2-TestACLHostsInNetMapTable-postgres.yaml | 68 +++++++++++++++++++ ...egration-v2-TestACLHostsInNetMapTable.yaml | 1 + ...v2-TestACLNamedHostsCanReach-postgres.yaml | 68 +++++++++++++++++++ ...egration-v2-TestACLNamedHostsCanReach.yaml | 1 + ...CLNamedHostsCanReachBySubnet-postgres.yaml | 68 +++++++++++++++++++ ...-v2-TestACLNamedHostsCanReachBySubnet.yaml | 1 + ...gration-v2-TestApiKeyCommand-postgres.yaml | 68 +++++++++++++++++++ ...test-integration-v2-TestApiKeyCommand.yaml | 1 + ...-TestAuthKeyLogoutAndRelogin-postgres.yaml | 68 +++++++++++++++++++ ...ration-v2-TestAuthKeyLogoutAndRelogin.yaml | 1 + ...WebFlowAuthenticationPingAll-postgres.yaml | 68 +++++++++++++++++++ ...-TestAuthWebFlowAuthenticationPingAll.yaml | 1 + ...tAuthWebFlowLogoutAndRelogin-postgres.yaml | 68 +++++++++++++++++++ ...on-v2-TestAuthWebFlowLogoutAndRelogin.yaml | 1 + ...ation-v2-TestCreateTailscale-postgres.yaml | 68 +++++++++++++++++++ ...st-integration-v2-TestCreateTailscale.yaml | 1 + ...on-v2-TestDERPServerScenario-postgres.yaml | 68 +++++++++++++++++++ ...integration-v2-TestDERPServerScenario.yaml | 1 + ...ableDisableAutoApprovedRoute-postgres.yaml | 68 +++++++++++++++++++ ...v2-TestEnableDisableAutoApprovedRoute.yaml | 1 + ...ration-v2-TestEnablingRoutes-postgres.yaml | 68 +++++++++++++++++++ ...est-integration-v2-TestEnablingRoutes.yaml | 1 + ...integration-v2-TestEphemeral-postgres.yaml | 68 +++++++++++++++++++ .../test-integration-v2-TestEphemeral.yaml | 1 + ...ntegration-v2-TestExpireNode-postgres.yaml | 68 +++++++++++++++++++ .../test-integration-v2-TestExpireNode.yaml | 1 + ...2-TestHASubnetRouterFailover-postgres.yaml | 68 +++++++++++++++++++ ...gration-v2-TestHASubnetRouterFailover.yaml | 1 + ...integration-v2-TestHeadscale-postgres.yaml | 68 +++++++++++++++++++ .../test-integration-v2-TestHeadscale.yaml | 1 + ...NodeAdvertiseTagNoACLCommand-postgres.yaml | 68 +++++++++++++++++++ ...n-v2-TestNodeAdvertiseTagNoACLCommand.yaml | 1 + ...deAdvertiseTagWithACLCommand-postgres.yaml | 68 +++++++++++++++++++ ...v2-TestNodeAdvertiseTagWithACLCommand.yaml | 1 + ...tegration-v2-TestNodeCommand-postgres.yaml | 68 +++++++++++++++++++ .../test-integration-v2-TestNodeCommand.yaml | 1 + ...ion-v2-TestNodeExpireCommand-postgres.yaml | 68 +++++++++++++++++++ ...-integration-v2-TestNodeExpireCommand.yaml | 1 + ...ation-v2-TestNodeMoveCommand-postgres.yaml | 68 +++++++++++++++++++ ...st-integration-v2-TestNodeMoveCommand.yaml | 1 + ...TestNodeOnlineLastSeenStatus-postgres.yaml | 68 +++++++++++++++++++ ...ation-v2-TestNodeOnlineLastSeenStatus.yaml | 1 + ...ion-v2-TestNodeRenameCommand-postgres.yaml | 68 +++++++++++++++++++ ...-integration-v2-TestNodeRenameCommand.yaml | 1 + ...ration-v2-TestNodeTagCommand-postgres.yaml | 68 +++++++++++++++++++ ...est-integration-v2-TestNodeTagCommand.yaml | 1 + ...estOIDCAuthenticationPingAll-postgres.yaml | 68 +++++++++++++++++++ ...tion-v2-TestOIDCAuthenticationPingAll.yaml | 1 + ...xpireNodesBasedOnTokenExpiry-postgres.yaml | 68 +++++++++++++++++++ ...TestOIDCExpireNodesBasedOnTokenExpiry.yaml | 1 + ...ion-v2-TestPingAllByHostname-postgres.yaml | 68 +++++++++++++++++++ ...-integration-v2-TestPingAllByHostname.yaml | 1 + ...tegration-v2-TestPingAllByIP-postgres.yaml | 68 +++++++++++++++++++ .../test-integration-v2-TestPingAllByIP.yaml | 1 + ...v2-TestPingAllByIPPublicDERP-postgres.yaml | 68 +++++++++++++++++++ ...egration-v2-TestPingAllByIPPublicDERP.yaml | 1 + ...ion-v2-TestPreAuthKeyCommand-postgres.yaml | 68 +++++++++++++++++++ ...-integration-v2-TestPreAuthKeyCommand.yaml | 1 + ...hKeyCommandReusableEphemeral-postgres.yaml | 68 +++++++++++++++++++ ...estPreAuthKeyCommandReusableEphemeral.yaml | 1 + ...eAuthKeyCommandWithoutExpiry-postgres.yaml | 68 +++++++++++++++++++ ...v2-TestPreAuthKeyCommandWithoutExpiry.yaml | 1 + ...ation-v2-TestResolveMagicDNS-postgres.yaml | 68 +++++++++++++++++++ ...st-integration-v2-TestResolveMagicDNS.yaml | 1 + ...ion-v2-TestSSHIsBlockedInACL-postgres.yaml | 68 +++++++++++++++++++ ...-integration-v2-TestSSHIsBlockedInACL.yaml | 1 + ...TestSSHMultipleUsersAllToAll-postgres.yaml | 68 +++++++++++++++++++ ...ation-v2-TestSSHMultipleUsersAllToAll.yaml | 1 + ...on-v2-TestSSHNoSSHConfigured-postgres.yaml | 68 +++++++++++++++++++ ...integration-v2-TestSSHNoSSHConfigured.yaml | 1 + ...ation-v2-TestSSHOneUserToAll-postgres.yaml | 68 +++++++++++++++++++ ...st-integration-v2-TestSSHOneUserToAll.yaml | 1 + ...-v2-TestSSHUserOnlyIsolation-postgres.yaml | 68 +++++++++++++++++++ ...tegration-v2-TestSSHUserOnlyIsolation.yaml | 1 + ...ration-v2-TestSubnetRouteACL-postgres.yaml | 68 +++++++++++++++++++ ...est-integration-v2-TestSubnetRouteACL.yaml | 1 + ...-integration-v2-TestTaildrop-postgres.yaml | 68 +++++++++++++++++++ .../test-integration-v2-TestTaildrop.yaml | 1 + ...ailscaleNodesJoiningHeadcale-postgres.yaml | 68 +++++++++++++++++++ ...-v2-TestTailscaleNodesJoiningHeadcale.yaml | 1 + ...tegration-v2-TestUserCommand-postgres.yaml | 68 +++++++++++++++++++ .../test-integration-v2-TestUserCommand.yaml | 1 + 92 files changed, 3174 insertions(+) create mode 100644 .github/workflows/test-integration-v2-TestACLAllowStarDst-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestACLAllowUser80Dst-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestACLAllowUserDst-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestACLDenyAllPort80-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestACLHostsInNetMapTable-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestACLNamedHostsCanReach-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestApiKeyCommand-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestCreateTailscale-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestDERPServerScenario-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestEnableDisableAutoApprovedRoute-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestEnablingRoutes-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestEphemeral-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestExpireNode-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestHASubnetRouterFailover-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestHeadscale-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeAdvertiseTagNoACLCommand-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeAdvertiseTagWithACLCommand-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeCommand-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeExpireCommand-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeMoveCommand-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeOnlineLastSeenStatus-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeRenameCommand-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestNodeTagCommand-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestPingAllByHostname-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestPingAllByIP-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestPingAllByIPPublicDERP-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestPreAuthKeyCommand-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestResolveMagicDNS-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestSSHIsBlockedInACL-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestSSHNoSSHConfigured-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestSSHOneUserToAll-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestSSHUserOnlyIsolation-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestSubnetRouteACL-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestTaildrop-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale-postgres.yaml create mode 100644 .github/workflows/test-integration-v2-TestUserCommand-postgres.yaml diff --git a/.github/workflows/test-integration-v2-TestACLAllowStarDst-postgres.yaml b/.github/workflows/test-integration-v2-TestACLAllowStarDst-postgres.yaml new file mode 100644 index 00000000000..fdac9774fc9 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestACLAllowStarDst-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestACLAllowStarDst-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestACLAllowStarDst-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestACLAllowStarDst-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestACLAllowStarDst$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml b/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml index 63017ac6f1e..1e1040190be 100644 --- a/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml +++ b/.github/workflows/test-integration-v2-TestACLAllowStarDst.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestACLAllowUser80Dst-postgres.yaml b/.github/workflows/test-integration-v2-TestACLAllowUser80Dst-postgres.yaml new file mode 100644 index 00000000000..9c3a23d9d05 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestACLAllowUser80Dst-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestACLAllowUser80Dst-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestACLAllowUser80Dst-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestACLAllowUser80Dst-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestACLAllowUser80Dst$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml b/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml index e3d5d2936d8..f0d6b5cf0bb 100644 --- a/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml +++ b/.github/workflows/test-integration-v2-TestACLAllowUser80Dst.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestACLAllowUserDst-postgres.yaml b/.github/workflows/test-integration-v2-TestACLAllowUserDst-postgres.yaml new file mode 100644 index 00000000000..a9c04f5fdd3 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestACLAllowUserDst-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestACLAllowUserDst-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestACLAllowUserDst-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestACLAllowUserDst-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestACLAllowUserDst$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml b/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml index dc328ede5f3..483179af65e 100644 --- a/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml +++ b/.github/workflows/test-integration-v2-TestACLAllowUserDst.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestACLDenyAllPort80-postgres.yaml b/.github/workflows/test-integration-v2-TestACLDenyAllPort80-postgres.yaml new file mode 100644 index 00000000000..948215dffbe --- /dev/null +++ b/.github/workflows/test-integration-v2-TestACLDenyAllPort80-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestACLDenyAllPort80-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestACLDenyAllPort80-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestACLDenyAllPort80-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestACLDenyAllPort80$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml b/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml index 396994a6ad3..aa9e0de70ee 100644 --- a/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml +++ b/.github/workflows/test-integration-v2-TestACLDenyAllPort80.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2-postgres.yaml b/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2-postgres.yaml new file mode 100644 index 00000000000..a8a9a3cf45e --- /dev/null +++ b/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestACLDevice1CanAccessDevice2-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestACLDevice1CanAccessDevice2-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestACLDevice1CanAccessDevice2-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestACLDevice1CanAccessDevice2$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml b/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml index 9af861f7ba5..4b60815eb30 100644 --- a/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml +++ b/.github/workflows/test-integration-v2-TestACLDevice1CanAccessDevice2.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable-postgres.yaml b/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable-postgres.yaml new file mode 100644 index 00000000000..73237bbec68 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestACLHostsInNetMapTable-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestACLHostsInNetMapTable-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestACLHostsInNetMapTable-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestACLHostsInNetMapTable$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml b/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml index cac45ba191b..e9cfeb23003 100644 --- a/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml +++ b/.github/workflows/test-integration-v2-TestACLHostsInNetMapTable.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach-postgres.yaml b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach-postgres.yaml new file mode 100644 index 00000000000..f38714127ea --- /dev/null +++ b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestACLNamedHostsCanReach-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestACLNamedHostsCanReach-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestACLNamedHostsCanReach-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestACLNamedHostsCanReach$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml index f0985228a16..1b99fc29947 100644 --- a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml +++ b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReach.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet-postgres.yaml b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet-postgres.yaml new file mode 100644 index 00000000000..0343b0b9b8d --- /dev/null +++ b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestACLNamedHostsCanReachBySubnet-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestACLNamedHostsCanReachBySubnet-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestACLNamedHostsCanReachBySubnet-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestACLNamedHostsCanReachBySubnet$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml index cee0e35c680..e323110f953 100644 --- a/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml +++ b/.github/workflows/test-integration-v2-TestACLNamedHostsCanReachBySubnet.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestApiKeyCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestApiKeyCommand-postgres.yaml new file mode 100644 index 00000000000..48e6db83d14 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestApiKeyCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestApiKeyCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestApiKeyCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestApiKeyCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestApiKeyCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestApiKeyCommand.yaml b/.github/workflows/test-integration-v2-TestApiKeyCommand.yaml index b495b9b37e2..edf50527acb 100644 --- a/.github/workflows/test-integration-v2-TestApiKeyCommand.yaml +++ b/.github/workflows/test-integration-v2-TestApiKeyCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin-postgres.yaml b/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin-postgres.yaml new file mode 100644 index 00000000000..670acb53a94 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestAuthKeyLogoutAndRelogin-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestAuthKeyLogoutAndRelogin-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestAuthKeyLogoutAndRelogin-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestAuthKeyLogoutAndRelogin$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml b/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml index fcdceeb0a2a..17bb803e476 100644 --- a/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml +++ b/.github/workflows/test-integration-v2-TestAuthKeyLogoutAndRelogin.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll-postgres.yaml b/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll-postgres.yaml new file mode 100644 index 00000000000..d2a54168e21 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestAuthWebFlowAuthenticationPingAll-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestAuthWebFlowAuthenticationPingAll-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestAuthWebFlowAuthenticationPingAll-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestAuthWebFlowAuthenticationPingAll$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml b/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml index 9e24a7d1d55..0bd94ff9f23 100644 --- a/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml +++ b/.github/workflows/test-integration-v2-TestAuthWebFlowAuthenticationPingAll.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin-postgres.yaml b/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin-postgres.yaml new file mode 100644 index 00000000000..50a4da8443b --- /dev/null +++ b/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestAuthWebFlowLogoutAndRelogin-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestAuthWebFlowLogoutAndRelogin-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestAuthWebFlowLogoutAndRelogin-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestAuthWebFlowLogoutAndRelogin$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml b/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml index e1ff6c3cfc8..f0077e73ed8 100644 --- a/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml +++ b/.github/workflows/test-integration-v2-TestAuthWebFlowLogoutAndRelogin.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestCreateTailscale-postgres.yaml b/.github/workflows/test-integration-v2-TestCreateTailscale-postgres.yaml new file mode 100644 index 00000000000..d80ec30058c --- /dev/null +++ b/.github/workflows/test-integration-v2-TestCreateTailscale-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestCreateTailscale-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestCreateTailscale-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestCreateTailscale-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestCreateTailscale$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestCreateTailscale.yaml b/.github/workflows/test-integration-v2-TestCreateTailscale.yaml index eaf829c553b..181d47acc6a 100644 --- a/.github/workflows/test-integration-v2-TestCreateTailscale.yaml +++ b/.github/workflows/test-integration-v2-TestCreateTailscale.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestDERPServerScenario-postgres.yaml b/.github/workflows/test-integration-v2-TestDERPServerScenario-postgres.yaml new file mode 100644 index 00000000000..4f60a311c04 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestDERPServerScenario-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestDERPServerScenario-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestDERPServerScenario-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestDERPServerScenario-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestDERPServerScenario$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml b/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml index 41c7db5094a..a1fe484bfaf 100644 --- a/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml +++ b/.github/workflows/test-integration-v2-TestDERPServerScenario.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestEnableDisableAutoApprovedRoute-postgres.yaml b/.github/workflows/test-integration-v2-TestEnableDisableAutoApprovedRoute-postgres.yaml new file mode 100644 index 00000000000..17da75c8c6c --- /dev/null +++ b/.github/workflows/test-integration-v2-TestEnableDisableAutoApprovedRoute-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestEnableDisableAutoApprovedRoute-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestEnableDisableAutoApprovedRoute-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestEnableDisableAutoApprovedRoute-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestEnableDisableAutoApprovedRoute$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestEnableDisableAutoApprovedRoute.yaml b/.github/workflows/test-integration-v2-TestEnableDisableAutoApprovedRoute.yaml index def07ccfbb6..0236cee0dcf 100644 --- a/.github/workflows/test-integration-v2-TestEnableDisableAutoApprovedRoute.yaml +++ b/.github/workflows/test-integration-v2-TestEnableDisableAutoApprovedRoute.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestEnablingRoutes-postgres.yaml b/.github/workflows/test-integration-v2-TestEnablingRoutes-postgres.yaml new file mode 100644 index 00000000000..d8e90580e8d --- /dev/null +++ b/.github/workflows/test-integration-v2-TestEnablingRoutes-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestEnablingRoutes-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestEnablingRoutes-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestEnablingRoutes-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestEnablingRoutes$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml b/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml index 750ea9ff0d6..6dbc36d9045 100644 --- a/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml +++ b/.github/workflows/test-integration-v2-TestEnablingRoutes.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestEphemeral-postgres.yaml b/.github/workflows/test-integration-v2-TestEphemeral-postgres.yaml new file mode 100644 index 00000000000..2f3f3a10e56 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestEphemeral-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestEphemeral-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestEphemeral-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestEphemeral-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestEphemeral$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestEphemeral.yaml b/.github/workflows/test-integration-v2-TestEphemeral.yaml index df037ee6401..fbcdf09786d 100644 --- a/.github/workflows/test-integration-v2-TestEphemeral.yaml +++ b/.github/workflows/test-integration-v2-TestEphemeral.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestExpireNode-postgres.yaml b/.github/workflows/test-integration-v2-TestExpireNode-postgres.yaml new file mode 100644 index 00000000000..bc82cab6c9d --- /dev/null +++ b/.github/workflows/test-integration-v2-TestExpireNode-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestExpireNode-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestExpireNode-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestExpireNode-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestExpireNode$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestExpireNode.yaml b/.github/workflows/test-integration-v2-TestExpireNode.yaml index 48e5e368e71..50d721bbcb1 100644 --- a/.github/workflows/test-integration-v2-TestExpireNode.yaml +++ b/.github/workflows/test-integration-v2-TestExpireNode.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestHASubnetRouterFailover-postgres.yaml b/.github/workflows/test-integration-v2-TestHASubnetRouterFailover-postgres.yaml new file mode 100644 index 00000000000..d63ee626f87 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestHASubnetRouterFailover-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestHASubnetRouterFailover-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestHASubnetRouterFailover-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestHASubnetRouterFailover-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestHASubnetRouterFailover$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestHASubnetRouterFailover.yaml b/.github/workflows/test-integration-v2-TestHASubnetRouterFailover.yaml index 4ffe46400a3..b926bb4b321 100644 --- a/.github/workflows/test-integration-v2-TestHASubnetRouterFailover.yaml +++ b/.github/workflows/test-integration-v2-TestHASubnetRouterFailover.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestHeadscale-postgres.yaml b/.github/workflows/test-integration-v2-TestHeadscale-postgres.yaml new file mode 100644 index 00000000000..f652a2a2699 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestHeadscale-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestHeadscale-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestHeadscale-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestHeadscale-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestHeadscale$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestHeadscale.yaml b/.github/workflows/test-integration-v2-TestHeadscale.yaml index ff7dbb1602f..59e6d6538e7 100644 --- a/.github/workflows/test-integration-v2-TestHeadscale.yaml +++ b/.github/workflows/test-integration-v2-TestHeadscale.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestNodeAdvertiseTagNoACLCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestNodeAdvertiseTagNoACLCommand-postgres.yaml new file mode 100644 index 00000000000..68a8a132383 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeAdvertiseTagNoACLCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeAdvertiseTagNoACLCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestNodeAdvertiseTagNoACLCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestNodeAdvertiseTagNoACLCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeAdvertiseTagNoACLCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeAdvertiseTagNoACLCommand.yaml b/.github/workflows/test-integration-v2-TestNodeAdvertiseTagNoACLCommand.yaml index f51fa612977..3ce3fb3b675 100644 --- a/.github/workflows/test-integration-v2-TestNodeAdvertiseTagNoACLCommand.yaml +++ b/.github/workflows/test-integration-v2-TestNodeAdvertiseTagNoACLCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestNodeAdvertiseTagWithACLCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestNodeAdvertiseTagWithACLCommand-postgres.yaml new file mode 100644 index 00000000000..d496abd817e --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeAdvertiseTagWithACLCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeAdvertiseTagWithACLCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestNodeAdvertiseTagWithACLCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestNodeAdvertiseTagWithACLCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeAdvertiseTagWithACLCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeAdvertiseTagWithACLCommand.yaml b/.github/workflows/test-integration-v2-TestNodeAdvertiseTagWithACLCommand.yaml index 9e0fcd28e65..2b26dbd4e4c 100644 --- a/.github/workflows/test-integration-v2-TestNodeAdvertiseTagWithACLCommand.yaml +++ b/.github/workflows/test-integration-v2-TestNodeAdvertiseTagWithACLCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestNodeCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestNodeCommand-postgres.yaml new file mode 100644 index 00000000000..8e6c1e11bb8 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestNodeCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestNodeCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeCommand.yaml b/.github/workflows/test-integration-v2-TestNodeCommand.yaml index 4398672f33b..4c0f5fc0a03 100644 --- a/.github/workflows/test-integration-v2-TestNodeCommand.yaml +++ b/.github/workflows/test-integration-v2-TestNodeCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestNodeExpireCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestNodeExpireCommand-postgres.yaml new file mode 100644 index 00000000000..3bb62cc5784 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeExpireCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeExpireCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestNodeExpireCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestNodeExpireCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeExpireCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeExpireCommand.yaml b/.github/workflows/test-integration-v2-TestNodeExpireCommand.yaml index f953a1c4278..5654a7ab9c4 100644 --- a/.github/workflows/test-integration-v2-TestNodeExpireCommand.yaml +++ b/.github/workflows/test-integration-v2-TestNodeExpireCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestNodeMoveCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestNodeMoveCommand-postgres.yaml new file mode 100644 index 00000000000..8c947d7c9cb --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeMoveCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeMoveCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestNodeMoveCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestNodeMoveCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeMoveCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeMoveCommand.yaml b/.github/workflows/test-integration-v2-TestNodeMoveCommand.yaml index ce5f5b90be0..e5af4412263 100644 --- a/.github/workflows/test-integration-v2-TestNodeMoveCommand.yaml +++ b/.github/workflows/test-integration-v2-TestNodeMoveCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestNodeOnlineLastSeenStatus-postgres.yaml b/.github/workflows/test-integration-v2-TestNodeOnlineLastSeenStatus-postgres.yaml new file mode 100644 index 00000000000..7197f8afb5e --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeOnlineLastSeenStatus-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeOnlineLastSeenStatus-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestNodeOnlineLastSeenStatus-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestNodeOnlineLastSeenStatus-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeOnlineLastSeenStatus$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeOnlineLastSeenStatus.yaml b/.github/workflows/test-integration-v2-TestNodeOnlineLastSeenStatus.yaml index e3a30f83858..fc38e0dd026 100644 --- a/.github/workflows/test-integration-v2-TestNodeOnlineLastSeenStatus.yaml +++ b/.github/workflows/test-integration-v2-TestNodeOnlineLastSeenStatus.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestNodeRenameCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestNodeRenameCommand-postgres.yaml new file mode 100644 index 00000000000..0ba311cf3b6 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeRenameCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeRenameCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestNodeRenameCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestNodeRenameCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeRenameCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeRenameCommand.yaml b/.github/workflows/test-integration-v2-TestNodeRenameCommand.yaml index e3ac56a1a65..a6f77296dd7 100644 --- a/.github/workflows/test-integration-v2-TestNodeRenameCommand.yaml +++ b/.github/workflows/test-integration-v2-TestNodeRenameCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestNodeTagCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestNodeTagCommand-postgres.yaml new file mode 100644 index 00000000000..c18fd64bd20 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestNodeTagCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestNodeTagCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestNodeTagCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestNodeTagCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestNodeTagCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestNodeTagCommand.yaml b/.github/workflows/test-integration-v2-TestNodeTagCommand.yaml index 5e1e57822da..d3f1b745449 100644 --- a/.github/workflows/test-integration-v2-TestNodeTagCommand.yaml +++ b/.github/workflows/test-integration-v2-TestNodeTagCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll-postgres.yaml b/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll-postgres.yaml new file mode 100644 index 00000000000..25b3c82077e --- /dev/null +++ b/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestOIDCAuthenticationPingAll-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestOIDCAuthenticationPingAll-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestOIDCAuthenticationPingAll-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestOIDCAuthenticationPingAll$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml b/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml index e333be2e072..7da113ec9bc 100644 --- a/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml +++ b/.github/workflows/test-integration-v2-TestOIDCAuthenticationPingAll.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry-postgres.yaml b/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry-postgres.yaml new file mode 100644 index 00000000000..b755720062a --- /dev/null +++ b/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestOIDCExpireNodesBasedOnTokenExpiry-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestOIDCExpireNodesBasedOnTokenExpiry-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestOIDCExpireNodesBasedOnTokenExpiry-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestOIDCExpireNodesBasedOnTokenExpiry$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml b/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml index 1f148c79b4c..8b3a5a81e19 100644 --- a/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml +++ b/.github/workflows/test-integration-v2-TestOIDCExpireNodesBasedOnTokenExpiry.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestPingAllByHostname-postgres.yaml b/.github/workflows/test-integration-v2-TestPingAllByHostname-postgres.yaml new file mode 100644 index 00000000000..869d18b0991 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestPingAllByHostname-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestPingAllByHostname-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestPingAllByHostname-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestPingAllByHostname-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestPingAllByHostname$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml b/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml index fe9ad76cd24..cbed2dc907d 100644 --- a/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml +++ b/.github/workflows/test-integration-v2-TestPingAllByHostname.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestPingAllByIP-postgres.yaml b/.github/workflows/test-integration-v2-TestPingAllByIP-postgres.yaml new file mode 100644 index 00000000000..e924304ad60 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestPingAllByIP-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestPingAllByIP-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestPingAllByIP-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestPingAllByIP-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestPingAllByIP$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestPingAllByIP.yaml b/.github/workflows/test-integration-v2-TestPingAllByIP.yaml index 156ef734001..0dd5c7edfc2 100644 --- a/.github/workflows/test-integration-v2-TestPingAllByIP.yaml +++ b/.github/workflows/test-integration-v2-TestPingAllByIP.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestPingAllByIPPublicDERP-postgres.yaml b/.github/workflows/test-integration-v2-TestPingAllByIPPublicDERP-postgres.yaml new file mode 100644 index 00000000000..fe9d3d664fb --- /dev/null +++ b/.github/workflows/test-integration-v2-TestPingAllByIPPublicDERP-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestPingAllByIPPublicDERP-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestPingAllByIPPublicDERP-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestPingAllByIPPublicDERP-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestPingAllByIPPublicDERP$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestPingAllByIPPublicDERP.yaml b/.github/workflows/test-integration-v2-TestPingAllByIPPublicDERP.yaml index 18fd34170fd..8418f767c7b 100644 --- a/.github/workflows/test-integration-v2-TestPingAllByIPPublicDERP.yaml +++ b/.github/workflows/test-integration-v2-TestPingAllByIPPublicDERP.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommand-postgres.yaml new file mode 100644 index 00000000000..7618e5e5282 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestPreAuthKeyCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestPreAuthKeyCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestPreAuthKeyCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestPreAuthKeyCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml index 11f10b08385..472def3ffbb 100644 --- a/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral-postgres.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral-postgres.yaml new file mode 100644 index 00000000000..363c094eb4e --- /dev/null +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestPreAuthKeyCommandReusableEphemeral-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestPreAuthKeyCommandReusableEphemeral-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestPreAuthKeyCommandReusableEphemeral-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestPreAuthKeyCommandReusableEphemeral$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml index 1be71ac75d0..1c8b943c43c 100644 --- a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandReusableEphemeral.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry-postgres.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry-postgres.yaml new file mode 100644 index 00000000000..5bfa959ff61 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestPreAuthKeyCommandWithoutExpiry-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestPreAuthKeyCommandWithoutExpiry-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestPreAuthKeyCommandWithoutExpiry-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestPreAuthKeyCommandWithoutExpiry$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml index 7d290cd4ddb..d44f9ca0996 100644 --- a/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml +++ b/.github/workflows/test-integration-v2-TestPreAuthKeyCommandWithoutExpiry.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestResolveMagicDNS-postgres.yaml b/.github/workflows/test-integration-v2-TestResolveMagicDNS-postgres.yaml new file mode 100644 index 00000000000..a10d6ef7b6c --- /dev/null +++ b/.github/workflows/test-integration-v2-TestResolveMagicDNS-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestResolveMagicDNS-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestResolveMagicDNS-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestResolveMagicDNS-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestResolveMagicDNS$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml b/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml index fbcf8081505..1ebb59eee52 100644 --- a/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml +++ b/.github/workflows/test-integration-v2-TestResolveMagicDNS.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL-postgres.yaml b/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL-postgres.yaml new file mode 100644 index 00000000000..da60d36c7d4 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestSSHIsBlockedInACL-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestSSHIsBlockedInACL-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestSSHIsBlockedInACL-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestSSHIsBlockedInACL$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml b/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml index bd19c8d5940..8098efce81e 100644 --- a/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml +++ b/.github/workflows/test-integration-v2-TestSSHIsBlockedInACL.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll-postgres.yaml b/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll-postgres.yaml new file mode 100644 index 00000000000..944990a77da --- /dev/null +++ b/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestSSHMultipleUsersAllToAll-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestSSHMultipleUsersAllToAll-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestSSHMultipleUsersAllToAll-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestSSHMultipleUsersAllToAll$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml b/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml index 00748aa29e5..5356fa90245 100644 --- a/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml +++ b/.github/workflows/test-integration-v2-TestSSHMultipleUsersAllToAll.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured-postgres.yaml b/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured-postgres.yaml new file mode 100644 index 00000000000..77633c217bc --- /dev/null +++ b/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestSSHNoSSHConfigured-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestSSHNoSSHConfigured-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestSSHNoSSHConfigured-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestSSHNoSSHConfigured$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml b/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml index be8f38a3762..346d69d8631 100644 --- a/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml +++ b/.github/workflows/test-integration-v2-TestSSHNoSSHConfigured.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestSSHOneUserToAll-postgres.yaml b/.github/workflows/test-integration-v2-TestSSHOneUserToAll-postgres.yaml new file mode 100644 index 00000000000..10a1334d77c --- /dev/null +++ b/.github/workflows/test-integration-v2-TestSSHOneUserToAll-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestSSHOneUserToAll-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestSSHOneUserToAll-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestSSHOneUserToAll-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestSSHOneUserToAll$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestSSHOneUserToAll.yaml b/.github/workflows/test-integration-v2-TestSSHOneUserToAll.yaml index 62ab49bec83..b696409bbd8 100644 --- a/.github/workflows/test-integration-v2-TestSSHOneUserToAll.yaml +++ b/.github/workflows/test-integration-v2-TestSSHOneUserToAll.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestSSHUserOnlyIsolation-postgres.yaml b/.github/workflows/test-integration-v2-TestSSHUserOnlyIsolation-postgres.yaml new file mode 100644 index 00000000000..d4acf63cff6 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestSSHUserOnlyIsolation-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestSSHUserOnlyIsolation-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestSSHUserOnlyIsolation-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestSSHUserOnlyIsolation-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestSSHUserOnlyIsolation$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestSSHUserOnlyIsolation.yaml b/.github/workflows/test-integration-v2-TestSSHUserOnlyIsolation.yaml index 8626453603e..7a2dcad4835 100644 --- a/.github/workflows/test-integration-v2-TestSSHUserOnlyIsolation.yaml +++ b/.github/workflows/test-integration-v2-TestSSHUserOnlyIsolation.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestSubnetRouteACL-postgres.yaml b/.github/workflows/test-integration-v2-TestSubnetRouteACL-postgres.yaml new file mode 100644 index 00000000000..1bfbbd06c57 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestSubnetRouteACL-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestSubnetRouteACL-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestSubnetRouteACL-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestSubnetRouteACL-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestSubnetRouteACL$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestSubnetRouteACL.yaml b/.github/workflows/test-integration-v2-TestSubnetRouteACL.yaml index 3cb3f112a7b..ce116c50b52 100644 --- a/.github/workflows/test-integration-v2-TestSubnetRouteACL.yaml +++ b/.github/workflows/test-integration-v2-TestSubnetRouteACL.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestTaildrop-postgres.yaml b/.github/workflows/test-integration-v2-TestTaildrop-postgres.yaml new file mode 100644 index 00000000000..7be2e147386 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestTaildrop-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestTaildrop-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestTaildrop-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestTaildrop-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestTaildrop$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestTaildrop.yaml b/.github/workflows/test-integration-v2-TestTaildrop.yaml index e64eedecf32..71feba5071d 100644 --- a/.github/workflows/test-integration-v2-TestTaildrop.yaml +++ b/.github/workflows/test-integration-v2-TestTaildrop.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale-postgres.yaml b/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale-postgres.yaml new file mode 100644 index 00000000000..a42767b0931 --- /dev/null +++ b/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestTailscaleNodesJoiningHeadcale-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestTailscaleNodesJoiningHeadcale-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestTailscaleNodesJoiningHeadcale-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestTailscaleNodesJoiningHeadcale$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml b/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml index c406b2b2915..63aff7a5452 100644 --- a/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml +++ b/.github/workflows/test-integration-v2-TestTailscaleNodesJoiningHeadcale.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \ diff --git a/.github/workflows/test-integration-v2-TestUserCommand-postgres.yaml b/.github/workflows/test-integration-v2-TestUserCommand-postgres.yaml new file mode 100644 index 00000000000..508719089ff --- /dev/null +++ b/.github/workflows/test-integration-v2-TestUserCommand-postgres.yaml @@ -0,0 +1,68 @@ +# DO NOT EDIT, generated with cmd/gh-action-integration-generator/main.go +# To regenerate, run "go generate" in cmd/gh-action-integration-generator/ + +name: Integration Test v2 - TestUserCommand-postgres + +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + TestUserCommand-postgres: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: satackey/action-docker-layer-caching@main + continue-on-error: true + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v34 + with: + files: | + *.nix + go.* + **/*.go + integration_test/ + config-example.yaml + + - name: Run TestUserCommand-postgres + uses: Wandalen/wretry.action@master + if: steps.changed-files.outputs.any_changed == 'true' + 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=1 \ + golang:1 \ + go run gotest.tools/gotestsum@latest -- ./... \ + -failfast \ + -timeout 120m \ + -parallel 1 \ + -run "^TestUserCommand$" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: logs + path: "control_logs/*.log" + + - uses: actions/upload-artifact@v3 + if: always() && steps.changed-files.outputs.any_changed == 'true' + with: + name: pprof + path: "control_logs/*.pprof.tar" diff --git a/.github/workflows/test-integration-v2-TestUserCommand.yaml b/.github/workflows/test-integration-v2-TestUserCommand.yaml index 667ad43e4b5..1e91b4ea5ca 100644 --- a/.github/workflows/test-integration-v2-TestUserCommand.yaml +++ b/.github/workflows/test-integration-v2-TestUserCommand.yaml @@ -47,6 +47,7 @@ jobs: --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=0 \ golang:1 \ go run gotest.tools/gotestsum@latest -- ./... \ -failfast \