Skip to content

Commit

Permalink
fix: let integration test use proper variable
Browse files Browse the repository at this point in the history
  • Loading branch information
defanator committed Jan 28, 2023
1 parent c1b18d9 commit ca9c86b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ performance-test: ## Run performance tests
$(CONTAINER_CLITOOL) run -v ${PWD}:/home/nginx/$(CONTAINER_VOLUME_FLAGS) --rm nginx-agent-benchmark:1.0.0

integration-test: local-deb-package
PACKAGE=${PACKAGE_NAME} DOCKER_IMAGE=${DOCKER_IMAGE} go test ./test/integration/api
PACKAGE=${PACKAGE_NAME} BASE_IMAGE=${BASE_IMAGE} go test ./test/integration/api

test-bench: ## Run benchmark tests
cd test/performance && GOWORK=off CGO_ENABLED=0 go test -mod=vendor -count 5 -timeout 2m -bench=. -benchmem metrics_test.go
Expand Down
4 changes: 2 additions & 2 deletions scripts/docker/nginx-oss/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG DOCKER_IMAGE
FROM ${DOCKER_IMAGE} as install
ARG BASE_IMAGE
FROM ${BASE_IMAGE} as install
LABEL maintainer="NGINX Agent Maintainers <[email protected]>"

ARG PACKAGE
Expand Down
2 changes: 1 addition & 1 deletion test/integration/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestAPI_setupTestContainer(t *testing.T) {
assert.NoError(t, comp.
WaitForService("agent", wait.ForLog("OneTimeRegistration completed")).WithEnv(map[string]string{
"PACKAGE": os.Getenv("PACKAGE"),
"DOCKER_IMAGE": os.Getenv("DOCKER_IMAGE"),
"BASE_IMAGE": os.Getenv("BASE_IMAGE"),
}).
Up(ctx, compose.Wait(true)), "compose.Up()")
}
Expand Down
5 changes: 2 additions & 3 deletions test/integration/api/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ networks:

services:
agent:
build:
build:
context: ../../../
dockerfile: ./scripts/docker/nginx-oss/ubuntu/Dockerfile
args:
PACKAGE: ${PACKAGE}
DOCKER_IMAGE: ${DOCKER_IMAGE}
BASE_IMAGE: ${BASE_IMAGE}
AGENT_CONF: "./test/testdata/configs/integration/api/nginx-agent.conf"
NGINX_CONF: "./test/testdata/configs/integration/api/nginx.conf"
ENTRY_POINT: "./scripts/docker/nginx-oss/entrypoint.sh"
ports:
- 9091:9091
networks:
- monitoring

0 comments on commit ca9c86b

Please sign in to comment.