Skip to content

Commit 677be9a

Browse files
authored
chore: add tailnet integration test CI job (#13181)
1 parent 72f2efe commit 677be9a

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
gomod: ${{ steps.filter.outputs.gomod }}
4141
offlinedocs-only: ${{ steps.filter.outputs.offlinedocs_count == steps.filter.outputs.all_count }}
4242
offlinedocs: ${{ steps.filter.outputs.offlinedocs }}
43+
tailnet-integration: ${{ steps.filter.outputs.tailnet-integration }}
4344
steps:
4445
- name: Checkout
4546
uses: actions/checkout@v4
@@ -107,6 +108,10 @@ jobs:
107108
- ".github/workflows/ci.yaml"
108109
offlinedocs:
109110
- "offlinedocs/**"
111+
tailnet-integration:
112+
- "tailnet/**"
113+
- "go.mod"
114+
- "go.sum"
110115
111116
- id: debug
112117
run: |
@@ -384,6 +389,30 @@ jobs:
384389
with:
385390
api-key: ${{ secrets.DATADOG_API_KEY }}
386391

392+
# Tailnet integration tests only run when the `tailnet` directory or `go.sum`
393+
# and `go.mod` are changed. These tests are to ensure we don't add regressions
394+
# to tailnet, either due to our code or due to updating dependencies.
395+
#
396+
# These tests are skipped in the main go test jobs because they require root
397+
# and mess with networking.
398+
test-go-tailnet-integration:
399+
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
400+
needs: changes
401+
# Unnecessary to run on main for now
402+
if: needs.changes.outputs.tailnet-integration == 'true' || needs.changes.outputs.ci == 'true'
403+
timeout-minutes: 20
404+
steps:
405+
- name: Checkout
406+
uses: actions/checkout@v4
407+
with:
408+
fetch-depth: 1
409+
410+
- name: Setup Go
411+
uses: ./.github/actions/setup-go
412+
413+
- name: Run Tests
414+
run: make test-tailnet-integration
415+
387416
test-js:
388417
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
389418
needs: changes

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,18 @@ test-race:
827827
gotestsum --junitfile="gotests.xml" -- -race -count=1 ./...
828828
.PHONY: test-race
829829

830+
test-tailnet-integration:
831+
env \
832+
CODER_TAILNET_TESTS=true \
833+
CODER_MAGICSOCK_DEBUG_LOGGING=true \
834+
TS_DEBUG_NETCHECK=true \
835+
GOTRACEBACK=single \
836+
go test \
837+
-exec "sudo -E" \
838+
-timeout=5m \
839+
-count=1 \
840+
./tailnet/test/integration
841+
830842
# Note: we used to add this to the test target, but it's not necessary and we can
831843
# achieve the desired result by specifying -count=1 in the go test invocation
832844
# instead. Keeping it here for convenience.

0 commit comments

Comments
 (0)