Skip to content

Commit

Permalink
client test depends on mock-api
Browse files Browse the repository at this point in the history
  • Loading branch information
gkostin1966 committed Nov 10, 2023
1 parent 4b5d541 commit 89728bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions apache/client/test/lauth/api_client_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ TEST(ApiClient, allowed_by_mock_http_client) {
ApiClient api_client(std::move(client));

Request req {
.ip = "",
.user = "authorized",
};

Expand All @@ -30,6 +31,7 @@ TEST(ApiClient, denied_by_mock_http_client) {
ApiClient api_client(std::move(client));

Request req {
.ip = "",
.user = "unauthorized",
};

Expand Down
13 changes: 12 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,28 @@ services:
- build_cache:/lauth/apache/build

mock-api:
profiles: [ "integration" ]
profiles: [ "test", "integration" ]
build:
context: ./
dockerfile: ./apache/Dockerfile
target: tests
ports:
- "127.0.0.1:9000:9000"
healthcheck:
test: [ "CMD", "curl", "--fail", "http://127.0.0.1:9000", "-s", "-o", "/dev/null" ]
interval: "10s"
timeout: "10s"
retries: 3
start_period: "2s"
start_interval: "1s"
command: ["./http-service", "9000"]

client-tests:
profiles: [ "test" ]
depends_on:
mock-api:
condition:
"service_healthy"
build:
context: ./
dockerfile: ./apache/Dockerfile
Expand Down

0 comments on commit 89728bf

Please sign in to comment.