Skip to content

Commit b0f1aca

Browse files
authored
Move test to internal/test (#825)
* Move test to internal/test * fix Makefile * fix dockerfiles * fix more paths * fix project root dir in kube tests * Fix testoutput * Fix/improve projectdir * Fixed K8s tests * Fix integration tests * Fix oats relative paths * Fix more paths * fix testoutput in few k8s tests
1 parent f5553db commit b0f1aca

File tree

721 files changed

+887
-868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

721 files changed

+887
-868
lines changed

.github/renovate.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
},
2828
{
2929
"description": "Disable Go 1.17 testserver updates",
30-
"matchFileNames": ["test/integration/components/testserver_1.17/Dockerfile"],
30+
"matchFileNames": ["internal/test/integration/components/testserver_1.17"],
3131
"matchDatasources": ["docker"],
3232
"matchPackageNames": ["golang"],
3333
"enabled": false

.github/workflows/ghcr_publish_testing_images.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,68 +96,68 @@ jobs:
9696
labels: ${{ steps.meta.outputs.labels }}
9797
tag-version: ${{ steps.image_tag.outputs.imgtag }}
9898
tag-id: rust
99-
file: test/integration/components/rusttestserver/Dockerfile
99+
file: internal/test/integration/components/rusttestserver/Dockerfile/rusttestserver/Dockerfile
100100

101101
- name: rust-ssl
102102
uses: ./.github/actions/integration-test-image-build
103103
with:
104104
labels: ${{ steps.meta.outputs.labels }}
105105
tag-version: ${{ steps.image_tag.outputs.imgtag }}
106106
tag-id: rust-ssl
107-
file: test/integration/components/rustssltestserver/Dockerfile
107+
file: internal/test/integration/components/rusttestserver/Dockerfile/rustssltestserver/Dockerfile
108108

109109
- name: rails
110110
uses: ./.github/actions/integration-test-image-build
111111
with:
112112
labels: ${{ steps.meta.outputs.labels }}
113113
tag-version: ${{ steps.image_tag.outputs.imgtag }}
114114
tag-id: rails
115-
file: test/integration/components/rubytestserver/testapi/Dockerfile
115+
file: internal/test/integration/components/rusttestserver/Dockerfile/rubytestserver/testapi/Dockerfile
116116

117117
- name: rails-ssl
118118
uses: ./.github/actions/integration-test-image-build
119119
with:
120120
labels: ${{ steps.meta.outputs.labels }}
121121
tag-version: ${{ steps.image_tag.outputs.imgtag }}
122122
tag-id: rails-ssl
123-
file: test/integration/components/rubytestserver/testapi/Dockerfile_tls
123+
file: internal/test/integration/components/rusttestserver/Dockerfile/rubytestserver/testapi/Dockerfile_tls
124124

125125
- name: java-jar
126126
uses: ./.github/actions/integration-test-image-build
127127
with:
128128
labels: ${{ steps.meta.outputs.labels }}
129129
tag-version: ${{ steps.image_tag.outputs.imgtag }}
130130
tag-id: java-jar
131-
file: test/integration/components/javatestserver/Dockerfile_jar
131+
file: internal/test/integration/components/rusttestserver/Dockerfile/javatestserver/Dockerfile_jar
132132

133133
- name: java-native
134134
uses: ./.github/actions/integration-test-image-build
135135
with:
136136
labels: ${{ steps.meta.outputs.labels }}
137137
tag-version: ${{ steps.image_tag.outputs.imgtag }}
138138
tag-id: java-native
139-
file: test/integration/components/javatestserver/Dockerfile
139+
file: internal/test/integration/components/rusttestserver/Dockerfile/javatestserver/Dockerfile
140140

141141
- name: node
142142
uses: ./.github/actions/integration-test-image-build
143143
with:
144144
labels: ${{ steps.meta.outputs.labels }}
145145
tag-version: ${{ steps.image_tag.outputs.imgtag }}
146146
tag-id: node
147-
file: test/integration/components/nodejsserver/Dockerfile
147+
file: internal/test/integration/components/rusttestserver/Dockerfile/nodejsserver/Dockerfile
148148

149149
- name: go
150150
uses: ./.github/actions/integration-test-image-build
151151
with:
152152
labels: ${{ steps.meta.outputs.labels }}
153153
tag-version: ${{ steps.image_tag.outputs.imgtag }}
154154
tag-id: go
155-
file: test/integration/components/testserver/Dockerfile
155+
file: internal/test/integration/components/rusttestserver/Dockerfile/testserver/Dockerfile
156156

157157
- name: python
158158
uses: ./.github/actions/integration-test-image-build
159159
with:
160160
labels: ${{ steps.meta.outputs.labels }}
161161
tag-version: ${{ steps.image_tag.outputs.imgtag }}
162162
tag-id: python
163-
file: test/integration/components/pythonserver/Dockerfile
163+
file: internal/test/integration/components/rusttestserver/Dockerfile/pythonserver/Dockerfile

.github/workflows/pull_request_integration_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
./.tools/gotestsum -ftestname \
8686
--jsonfile=/home/runner/reports/test-run-"${RUN_NUMBER}"-"${MATRIX_ID}".log \
8787
-- -race -tags=${TEST_TAGS} -timeout 30m \
88-
-run="^(${MATRIX_TEST_PATTERN})$" ./test/integration/...
88+
-run="^(${MATRIX_TEST_PATTERN})$" ./internal/test/integration/...
8989
9090
- name: Process coverage data
9191
run: make itest-coverage-data

.github/workflows/workflow_integration_tests_vm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- name: Pre-compile Go integration tests
7474
run: |
7575
mkdir compiled-tests
76-
CC=musl-gcc CGO_ENABLED=1 go test -c -tags=integration -ldflags="-s -w" -o compiled-tests/ ./test/integration/...
76+
CC=musl-gcc CGO_ENABLED=1 go test -c -tags=integration -ldflags="-s -w" -o compiled-tests/ ./internal/test/integration/...
7777
7878
- name: Run VM integration tests (${{ matrix.test.description }})
7979
timeout-minutes: 60

.gitignore

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -20,73 +20,73 @@ testoutput
2020
**/vendor/
2121

2222
deployments/01-grafana-credentials.yml
23-
test/cmd/pingserver/server
23+
internal/test/cmd/pingserver/server
2424
*.log
2525
**/.vscode
2626
.idea/
27-
test/cmd/grpc/server/server
28-
test/cmd/grpc/client/client
27+
internal/test/cmd/grpc/server/server
28+
internal/test/cmd/grpc/client/client
2929

3030
.tools/
3131
bin/
32-
test/integration/components/server
33-
test/integration/components/testserver/testserver
32+
internal/test/integration/components/server
33+
internal/test/integration/components/testserver/testserver
3434

35-
test/cmd/rust_pingserver/target
36-
test/cmd/rust_pingiron/target
37-
test/cmd/rust_pingrouille/target
38-
test/cmd/rust_ironssl/target
35+
internal/test/cmd/rust_pingserver/target
36+
internal/test/cmd/rust_pingiron/target
37+
internal/test/cmd/rust_pingrouille/target
38+
internal/test/cmd/rust_ironssl/target
3939
*__pycache__/
40-
test/cmd/pingwrapper/wrapper
41-
test/cmd/grpc/server/grpcsrv
42-
test/cmd/greeting-service/target
43-
test/integration/components/javatestserver/target/
44-
test/integration/components/rusttestserver/target/
45-
test/integration/components/rustssltestserver/target/
46-
test/integration/components/nodejsserver/node_modules/
40+
internal/test/cmd/pingwrapper/wrapper
41+
internal/test/cmd/grpc/server/grpcsrv
42+
internal/test/cmd/greeting-service/target
43+
internal/test/integration/components/javatestserver/target/
44+
internal/test/integration/components/rusttestserver/target/
45+
internal/test/integration/components/rustssltestserver/target/
46+
internal/test/integration/components/nodejsserver/node_modules/
4747
# Ruby on Rails test
4848
# Ignore bundler config.
49-
test/integration/components/rubytestserver/testapi/.bundle
49+
internal/test/integration/components/rubytestserver/testapi/.bundle
5050

5151
# Ignore the default SQLite database.
52-
test/integration/components/rubytestserver/testapi/db/*.sqlite3
53-
test/integration/components/rubytestserver/testapi/db/*.sqlite3-*
52+
internal/test/integration/components/rubytestserver/testapi/db/*.sqlite3
53+
internal/test/integration/components/rubytestserver/testapi/db/*.sqlite3-*
5454

5555
# Ignore all logfiles and tempfiles.
56-
test/integration/components/rubytestserver/testapi/log/*
57-
test/integration/components/rubytestserver/testapi/tmp/*
58-
!test/integration/components/rubytestserver/testapi/log/.keep
59-
!test/integration/components/rubytestserver/testapi/tmp/.keep
56+
internal/test/integration/components/rubytestserver/testapi/log/*
57+
internal/test/integration/components/rubytestserver/testapi/tmp/*
58+
!internal/test/internal/integration/components/rubytestserver/testapi/log/.keep
59+
!internal/test/internal/integration/components/rubytestserver/testapi/tmp/.keep
6060

6161
# Ignore pidfiles, but keep the directory.
62-
test/integration/components/rubytestserver/testapi/tmp/pids/*
63-
!test/integration/components/rubytestserver/testapi/tmp/pids/
64-
!test/integration/components/rubytestserver/testapi/tmp/pids/.keep
62+
internal/test/integration/components/rubytestserver/testapi/tmp/pids/*
63+
!internal/test/internal/integration/components/rubytestserver/testapi/tmp/pids/
64+
!internal/test/internal/integration/components/rubytestserver/testapi/tmp/pids/.keep
6565

6666
# Ignore uploaded files in development.
67-
test/integration/components/rubytestserver/testapi/storage/*
68-
!test/integration/components/rubytestserver/testapi/storage/.keep
69-
test/integration/components/rubytestserver/testapi/tmp/storage/*
70-
!test/integration/components/rubytestserver/testapi/tmp/storage/
71-
!test/integration/components/rubytestserver/testapi/tmp/storage/.keep
72-
test/integration/components/dotnetserver/obj/*
73-
test/oats/*/build/*
74-
test/cmd/grpc/client/grpclient
75-
test/integration/components/gohttp2/client/client
76-
test/integration/components/gohttp2/server/http2srv
77-
test/integration/components/gokafka/gokafka
78-
test/integration/components/gokafka-seg/gokafka
79-
test/integration/components/goredis/goredis
80-
test/integration/components/go_otel/rolldice
81-
test/integration/components/go_otel_grpc/rolldice
82-
test/integration/components/pythonserver/lib/
83-
test/integration/components/pythonserver/lib64
84-
test/integration/components/pythonserver/pyvenv.cfg
85-
test/integration/components/gosql/qosql
67+
internal/test/integration/components/rubytestserver/testapi/storage/*
68+
!internal/test/internal/integration/components/rubytestserver/testapi/storage/.keep
69+
internal/test/integration/components/rubytestserver/testapi/tmp/storage/*
70+
!internal/test/internal/integration/components/rubytestserver/testapi/tmp/storage/
71+
!internal/test/internal/integration/components/rubytestserver/testapi/tmp/storage/.keep
72+
internal/test/integration/components/dotnetserver/obj/*
73+
internal/test/oats/*/build/*
74+
internal/test/cmd/grpc/client/grpclient
75+
internal/test/integration/components/gohttp2/client/client
76+
internal/test/integration/components/gohttp2/server/http2srv
77+
internal/test/integration/components/gokafka/gokafka
78+
internal/test/integration/components/gokafka-seg/gokafka
79+
internal/test/integration/components/goredis/goredis
80+
internal/test/integration/components/go_otel/rolldice
81+
internal/test/integration/components/go_otel_grpc/rolldice
82+
internal/test/integration/components/pythonserver/lib/
83+
internal/test/integration/components/pythonserver/lib64
84+
internal/test/integration/components/pythonserver/pyvenv.cfg
85+
internal/test/integration/components/gosql/qosql
8686
*_bpfel.go
8787
*_bpfel.o
8888
pkg/internal/otelsdk/grafana-opentelemetry-java.jar
8989
opentelemetry-ebpf-instrumentation.sln
9090
obi.sln
91-
test/integration/components/javakafka/target/*
92-
test/integration/components/gomongo/mongosrv
91+
internal/test/integration/components/javakafka/target/*
92+
internal/test/integration/components/gomongo/mongosrv

Makefile

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ CLANG_TIDY ?= clang-tidy
4242
CILIUM_EBPF_VER ?= $(call gomod-version,cilium/ebpf)
4343

4444
# regular expressions for excluded file patterns
45-
EXCLUDE_COVERAGE_FILES="(_bpfel.go)|(/opentelemetry-ebpf-instrumentation/test/)|(/opentelemetry-ebpf-instrumentation/configs/)|(.pb.go)|(/pkg/export/otel/metric/)|(/cmd/obi-genfiles)"
45+
EXCLUDE_COVERAGE_FILES="(_bpfel.go)|(/opentelemetry-ebpf-instrumentation/internal/test/)|(/opentelemetry-ebpf-instrumentation/configs/)|(.pb.go)|(/pkg/export/otel/metric/)|(/cmd/obi-genfiles)"
4646

4747
.DEFAULT_GOAL := all
4848

@@ -263,13 +263,13 @@ cleanup-integration-test: $(KIND)
263263
run-integration-test:
264264
@echo "### Running integration tests"
265265
go clean -testcache
266-
go test -p 1 -failfast -v -timeout 60m -a ./test/integration/... --tags=integration
266+
go test -p 1 -failfast -v -timeout 60m -a ./internal/test/integration/... --tags=integration
267267

268268
.PHONY: run-integration-test-k8s
269269
run-integration-test-k8s:
270270
@echo "### Running integration tests"
271271
go clean -testcache
272-
go test -p 1 -failfast -v -timeout 60m -a ./test/integration/... --tags=integration_k8s
272+
go test -p 1 -failfast -v -timeout 60m -a ./internal/test/integration/... --tags=integration_k8s
273273

274274
.PHONY: run-integration-test-vm
275275
run-integration-test-vm:
@@ -294,30 +294,30 @@ run-integration-test-vm:
294294
-failfast \
295295
-v -a \
296296
-tags=integration \
297-
-run="^($(TEST_PATTERN))\$$" ./test/integration/...; \
297+
-run="^($(TEST_PATTERN))\$$" ./internal/test/integration/...; \
298298
fi
299299

300300
.PHONY: run-integration-test-arm
301301
run-integration-test-arm:
302302
@echo "### Running integration tests"
303303
go clean -testcache
304-
go test -p 1 -failfast -v -timeout 90m -a ./test/integration/... --tags=integration -run "^TestMultiProcess"
304+
go test -p 1 -failfast -v -timeout 90m -a ./internal/test/integration/... --tags=integration -run "^TestMultiProcess"
305305

306306
.PHONY: integration-test-matrix-json
307307
integration-test-matrix-json:
308-
@./scripts/generate-integration-matrix.sh "$${TEST_TAGS:-integration}" test/integration "$${PARTITIONS:-5}"
308+
@./scripts/generate-integration-matrix.sh "$${TEST_TAGS:-integration}" internal/test/integration "$${PARTITIONS:-5}"
309309

310310
.PHONY: vm-integration-test-matrix-json
311311
vm-integration-test-matrix-json:
312-
@./scripts/generate-integration-matrix.sh "$${TEST_TAGS:-integration}" test/integration "$${PARTITIONS:-3}" "TestMultiProcess"
312+
@./scripts/generate-integration-matrix.sh "$${TEST_TAGS:-integration}" internal/test/integration "$${PARTITIONS:-3}" "TestMultiProcess"
313313

314314
.PHONY: k8s-integration-test-matrix-json
315315
k8s-integration-test-matrix-json:
316-
@./scripts/generate-dir-matrix.sh test/integration/k8s common
316+
@./scripts/generate-dir-matrix.sh internal/test/integration/k8s common
317317

318318
.PHONY: oats-integration-test-matrix-json
319319
oats-integration-test-matrix-json:
320-
@./scripts/generate-dir-matrix.sh test/oats
320+
@./scripts/generate-dir-matrix.sh internal/test/oats
321321

322322
.PHONY: integration-test
323323
integration-test: prereqs prepare-integration-test
@@ -354,36 +354,36 @@ oats-prereq: $(GINKGO) docker-generate
354354

355355
.PHONY: oats-test-sql
356356
oats-test-sql: oats-prereq
357-
mkdir -p test/oats/sql/$(TEST_OUTPUT)/run
358-
cd test/oats/sql && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
357+
mkdir -p internal/test/oats/sql/$(TEST_OUTPUT)/run
358+
cd internal/test/oats/sql && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
359359

360360
.PHONY: oats-test-redis
361361
oats-test-redis: oats-prereq
362-
mkdir -p test/oats/redis/$(TEST_OUTPUT)/run
363-
cd test/oats/redis && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
362+
mkdir -p internal/test/oats/redis/$(TEST_OUTPUT)/run
363+
cd internal/test/oats/redis && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
364364

365365
.PHONY: oats-test-kafka
366366
oats-test-kafka: oats-prereq
367-
mkdir -p test/oats/kafka/$(TEST_OUTPUT)/run
368-
cd test/oats/kafka && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
367+
mkdir -p internal/test/oats/kafka/$(TEST_OUTPUT)/run
368+
cd internal/test/oats/kafka && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
369369

370370
.PHONY: oats-test-http
371371
oats-test-http: oats-prereq
372-
mkdir -p test/oats/http/$(TEST_OUTPUT)/run
373-
cd test/oats/http && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
372+
mkdir -p internal/test/oats/http/$(TEST_OUTPUT)/run
373+
cd internal/test/oats/http && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
374374

375375
.PHONY: oats-test-mongo
376376
oats-test-mongo: oats-prereq
377-
mkdir -p test/oats/mongo/$(TEST_OUTPUT)/run
378-
cd test/oats/mongo && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
377+
mkdir -p internal/test/oats/mongo/$(TEST_OUTPUT)/run
378+
cd internal/test/oats/mongo && TESTCASE_TIMEOUT=5m TESTCASE_BASE_PATH=./yaml $(GINKGO) -v -r
379379

380380
.PHONY: oats-test
381381
oats-test: oats-test-sql oats-test-mongo oats-test-redis oats-test-kafka oats-test-http
382382
$(MAKE) itest-coverage-data
383383

384384
.PHONY: oats-test-debug
385385
oats-test-debug: oats-prereq
386-
cd test/oats/kafka && TESTCASE_BASE_PATH=./yaml TESTCASE_MANUAL_DEBUG=true TESTCASE_TIMEOUT=1h $(GINKGO) -v -r
386+
cd internal/test/oats/kafka && TESTCASE_BASE_PATH=./yaml TESTCASE_MANUAL_DEBUG=true TESTCASE_TIMEOUT=1h $(GINKGO) -v -r
387387

388388
.PHONY: license-header-check
389389
license-header-check:

README.md

Lines changed: 1 addition & 1 deletion
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)