Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow is required to ensure that required Github check passes even if
# the actual "Unit Tests (Operator)" workflow skipped due to path filtering. Otherwise
# the actual "Unit Tests (Integrations)" workflow skipped due to path filtering. Otherwise
# it will stay forever pending.
#
# See "Handling skipped but required checks" for more info:
Expand All @@ -8,8 +8,8 @@
#
# Note both workflows must have the same name.

name: Unit Tests (Operator)
run-name: Skip Unit Tests (Operator) - ${{ github.run_id }} - @${{ github.actor }}
name: Unit Tests (Integrations)
run-name: Skip Unit Tests (Integrations) - ${{ github.run_id }} - @${{ github.actor }}

on:
pull_request:
Expand All @@ -33,7 +33,7 @@ on:

jobs:
test:
name: Unit Tests (Operator)
name: Unit Tests (Integrations)
runs-on: ubuntu-latest

permissions:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Unit Tests (Operator)
run-name: Unit Tests (Operator) - ${{ github.run_id }} - @${{ github.actor }}
name: Unit Tests (Integrations)
run-name: Unit Tests (Integrations) - ${{ github.run_id }} - @${{ github.actor }}

on:
push:
Expand Down Expand Up @@ -28,7 +28,7 @@ on:

jobs:
test:
name: Unit Tests (Operator)
name: Unit Tests (Integrations)
if: ${{ !startsWith(github.head_ref, 'dependabot/') }}
runs-on: ubuntu-22.04-16core

Expand All @@ -38,6 +38,9 @@ jobs:
container:
image: ghcr.io/gravitational/teleport-buildbox:teleport12
options: --cap-add=SYS_ADMIN --privileged
env:
TELEPORT_GET_VERSION: v12.1.0
TELEPORT_ENTERPRISE_LICENSE: ${{ secrets.TELEPORT_ENTERPRISE_LICENSE }}

steps:
- name: Checkout Teleport
Expand All @@ -46,6 +49,14 @@ jobs:
- name: Prepare workspace
uses: ./.github/actions/prepare-workspace

- name: Run tests
- name: Run access plugin tests
run: make test-access-integrations
timeout-minutes: 5

- name: Run integrations lib tests
run: make test-integrations-lib
timeout-minutes: 5

- name: Run operator tests
timeout-minutes: 40
run: make test-operator
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -574,12 +574,11 @@ test-helm-update-snapshots: helmunit/installed
.PHONY: test-go
test-go: ensure-webassets bpf-bytecode rdpclient $(TEST_LOG_DIR) $(RENDER_TESTS)
test-go: FLAGS ?= -race -shuffle on
test-go: PACKAGES = $(shell go list ./... | grep -v -e integration -e tool/tsh -e operator )
test-go: PACKAGES = $(shell go list ./... | grep -v -e integration -e tool/tsh -e operator -e integrations/access -e integrations/lib )
test-go: CHAOS_FOLDERS = $(shell find . -type f -name '*chaos*.go' | xargs dirname | uniq)
test-go: $(VERSRC) $(TEST_LOG_DIR)
$(CGOFLAG) go test -cover -json -tags "$(PAM_TAG) $(FIPS_TAG) $(BPF_TAG) $(RDPCLIENT_TAG) $(TOUCHID_TAG) $(PIV_TEST_TAG)" $(PACKAGES) $(FLAGS) $(ADDFLAGS) \
| tee $(TEST_LOG_DIR)/unit.json \
| ${RENDER_TESTS}

# rdpclient and libfido2 don't play well together, so we run libfido2 tests
# separately.
# TODO(codingllama): Run libfido2 tests along with others once RDP doesn't
Expand Down Expand Up @@ -635,6 +634,14 @@ test-api: $(VERSRC) $(TEST_LOG_DIR) $(RENDER_TESTS)
test-operator:
make -C operator test

.PHONY: test-access-integrations
test-access-integrations:
make -C integrations test-access

.PHONY: test-integrations-lib
test-integrations-lib:
make -C integrations test-lib

#
# Runs Go tests on the examples/teleport-usage module. These have to be run separately as the package name is different.
#
Expand Down Expand Up @@ -682,7 +689,7 @@ run-etcd:
#
.PHONY: integration
integration: FLAGS ?= -v -race
integration: PACKAGES = $(shell go list ./... | grep integration)
integration: PACKAGES = $(shell go list ./... | grep 'integration\([^s]\|$$\)' | grep -v integrations/lib/testing/integration )
integration: $(TEST_LOG_DIR) $(RENDER_TESTS)
@echo KUBECONFIG is: $(KUBECONFIG), TEST_KUBE: $(TEST_KUBE)
$(CGOFLAG) go test -timeout 30m -json -tags "$(PAM_TAG) $(FIPS_TAG) $(BPF_TAG) $(RDPCLIENT_TAG)" $(PACKAGES) $(FLAGS) \
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ require (
github.com/go-mysql-org/go-mysql v1.5.0 // replaced
github.com/go-piv/piv-go v1.10.0
github.com/go-redis/redis/v9 v9.0.0-rc.1 // replaced
github.com/go-resty/resty/v2 v2.3.0
github.com/go-webauthn/webauthn v0.5.0
github.com/gobuffalo/flect v1.0.0 // indirect
github.com/gocql/gocql v1.3.1
Expand All @@ -75,6 +76,7 @@ require (
github.com/gravitational/trace v1.2.1
github.com/gravitational/ttlmap v0.0.0-20171116003245-91fd36b9004c
github.com/grpc-ecosystem/go-grpc-middleware/providers/openmetrics/v2 v2.0.0-rc.3
github.com/hashicorp/go-version v1.2.0
github.com/hashicorp/golang-lru v0.6.0
github.com/jackc/pgconn v1.13.0
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa
Expand All @@ -97,6 +99,7 @@ require (
github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f
github.com/okta/okta-sdk-golang/v2 v2.17.0
github.com/pavlo-v-chernykh/keystore-go/v4 v4.4.1
github.com/pelletier/go-toml v1.2.0
github.com/pkg/sftp v1.13.5 // replaced
github.com/pquerna/otp v1.4.0
github.com/prometheus/client_golang v1.14.0
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,8 @@ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+
github.com/go-piv/piv-go v1.10.0 h1:P1Y1VjBI5DnXW0+YkKmTuh5opWnMIrKriUaIOblee9Q=
github.com/go-piv/piv-go v1.10.0/go.mod h1:NZ2zmjVkfFaL/CF8cVQ/pXdXtuj110zEKGdJM6fJZZM=
github.com/go-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-resty/resty/v2 v2.3.0 h1:JOOeAvjSlapTT92p8xiS19Zxev1neGikoHsXJeOq8So=
github.com/go-resty/resty/v2 v2.3.0/go.mod h1:UpN9CgLZNsv4e9XG50UU8xdI0F43UQ4HmxLBDwaroHU=
github.com/go-sql-driver/mysql v1.3.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
Expand Down Expand Up @@ -725,6 +727,7 @@ github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E=
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
Expand Down Expand Up @@ -1044,6 +1047,7 @@ github.com/patrickmn/go-cache v0.0.0-20180815053127-5633e0862627/go.mod h1:3Qf8k
github.com/pavlo-v-chernykh/keystore-go/v4 v4.4.1 h1:FyBdsRqqHH4LctMLL+BL2oGO+ONcIPwn96ctofCVtNE=
github.com/pavlo-v-chernykh/keystore-go/v4 v4.4.1/go.mod h1:lAVhWwbNaveeJmxrxuSTxMgKpF6DjnuVpn6T8WiBwYQ=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
Expand Down
Empty file added integrations/.gitkeep
Empty file.
28 changes: 28 additions & 0 deletions integrations/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Set up a system-agnostic in-place sed command
IS_GNU_SED = $(shell sed --version 1>/dev/null 2>&1 && echo true || echo false)

ifeq ($(IS_GNU_SED),true)
SED = sed -i
else
SED = sed -i ''
endif

TELEPORT_GET_VERSION ?= v12.1.0
.PHONY: update-test-version
update-test-version:
curl https://get.gravitational.com/teleport-{ent-,}${TELEPORT_GET_VERSION}-{darwin-amd64,linux-{amd64,arm64,arm}}-bin.tar.gz.sha256 > \
lib/testing/integration/download_sha.dsv
(cd ../ && \
$(SED) 's/TELEPORT_GET_VERSION: .*/TELEPORT_GET_VERSION: $(TELEPORT_GET_VERSION)/g' .github/workflows/unit-tests-integrations.yaml \
)

.PHONY: test
test: test-access test-lib

.PHONY: test-access
test-access:
go test -v ./access/...

.PHONY: test-lib
test-lib:
go test ./lib/...
Loading