Skip to content

Commit e5f6418

Browse files
committed
testagain
1 parent 39e1469 commit e5f6418

File tree

4 files changed

+80
-93
lines changed

4 files changed

+80
-93
lines changed
Lines changed: 61 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,72 @@
1-
# # This workflow will build a .NET project
2-
# # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
33

4-
# name: build_and_test_2
4+
name: build_and_test_2
55

6-
# on:
7-
# push:
8-
# branches: [ "tenants_and_users" ]
9-
# pull_request:
10-
# branches: [ "tenants_and_users" ]
6+
on:
7+
push:
8+
branches: [ "tenants_and_users" ]
9+
pull_request:
10+
branches: [ "tenants_and_users" ]
1111

12-
# jobs:
13-
# build:
14-
# runs-on: ubuntu-latest
15-
# services:
16-
# docker:
17-
# image: docker:27.2.0
18-
# options: --privileged
19-
# # ports:
20-
# # - 8082:8080
21-
# # - 5435:5432
22-
# # - 15672:15672
23-
# # - 5672:5672
24-
# # - 6379:6379
25-
# # - 6380:6379
26-
# # - 8001:8001
27-
# # - 8004:8004
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
services:
16+
docker:
17+
image: docker:27.2.0
18+
options: --privileged
19+
# ports:
20+
# - 8082:8080
21+
# - 5435:5432
22+
# - 15672:15672
23+
# - 5672:5672
24+
# - 6379:6379
25+
# - 6380:6379
26+
# - 8001:8001
27+
# - 8004:8004
2828

29-
# defaults:
30-
# run:
31-
# working-directory: ./
32-
# steps:
33-
# - name: Checkout repo
34-
# uses: actions/checkout@v4
29+
defaults:
30+
run:
31+
working-directory: ./
32+
steps:
33+
- name: Checkout repo
34+
uses: actions/checkout@v4
3535

36-
# - name: Run docker compose
37-
# run: docker compose -f docker-compose.yml up --build -d
38-
# working-directory: ./
36+
- name: Run docker compose
37+
run: docker compose -f docker-compose.yml -f docker-integration-tests.yml up --build -d
38+
working-directory: ./
3939

40-
# - name: Print Docker Compose logs
41-
# run: docker compose logs
40+
- name: Print Docker Compose logs
41+
run: docker compose logs
4242

43-
# # - name: Set up Docker Compose
44-
# # uses: hoverkraft-tech/compose-action@v2.0.2
45-
# # with:
46-
# # compose-file: |
47-
# # docker-compose.yml
48-
# # docker-integration-tests.yml
43+
- name: Dump all logs
44+
uses: jwalton/gh-docker-logs@v2
45+
with:
46+
images: 'ubik-security-api-test'
47+
tail: '500'
4948

50-
# - name: Setup .NET
51-
# uses: actions/setup-dotnet@v3
52-
# with:
53-
# dotnet-version: 8.0.x
49+
# - name: Set up Docker Compose
50+
# uses: hoverkraft-tech/compose-action@v2.0.2
51+
# with:
52+
# compose-file: |
53+
# docker-compose.yml
54+
# docker-integration-tests.yml
5455

55-
# - name: Restore dependencies
56-
# run: dotnet restore
57-
# working-directory: ./src/
56+
- name: Setup .NET
57+
uses: actions/setup-dotnet@v3
58+
with:
59+
dotnet-version: 8.0.x
5860

59-
# - name: Build
60-
# run: dotnet build -c Debug --no-restore
61-
# working-directory: ./src/
61+
- name: Restore dependencies
62+
run: dotnet restore
63+
working-directory: ./src/
6264

63-
# - name: Test
64-
# if: ${{ success() }}
65-
# run: dotnet test -c Debug --no-build --no-restore
66-
# working-directory: ./src/
65+
- name: Build
66+
run: dotnet build -c Debug --no-restore
67+
working-directory: ./src/
68+
69+
- name: Test
70+
if: ${{ success() }}
71+
run: dotnet test -c Debug --no-build --no-restore
72+
working-directory: ./src/

docker-compose.yml

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -200,44 +200,6 @@ services:
200200
expose:
201201
- "5435"
202202

203-
security-api-test:
204-
build:
205-
context: ./
206-
dockerfile: src/Ubik.Security.Api/Dockerfile
207-
container_name: "security-api-test"
208-
environment:
209-
- "ASPNETCORE_ENVIRONMENT=Development"
210-
- "AuthServer__MetadataAddress=http://keycloak:8080/realms/ubik/.well-known/openid-configuration"
211-
- "AuthServer__Authority=http://keycloak:8080/realms/ubik"
212-
- "AuthServer__AuthorizationUrl=http://keycloak:8080/realms/ubik/protocol/openid-connect/auth"
213-
- "AuthServer__TokenUrl=http://keycloak:8080/realms/ubik/.protocol/openid-connect/token"
214-
- "ConnectionStrings__SecurityDbContext=Host=db-test;Port=5432;Database=ubik_security;Username=postgres;Password=test01"
215-
- "AuthManagerKeyCloakClient__RootUrl=http://keycloak:8080/"
216-
- "MessageBroker__Host=amqp://rabbit:5672"
217-
depends_on:
218-
rabbitmq:
219-
condition: service_started
220-
keycloak-last:
221-
condition: service_healthy
222-
ubik-proxy-cache:
223-
condition: service_started
224-
ubik-postgres:
225-
condition: service_started
226-
networks:
227-
- ubik-network
228-
ports:
229-
- "5000:8080"
230-
231-
finisher:
232-
container_name: wait-for-completion
233-
image: alpine
234-
healthcheck:
235-
test: exit 0
236-
interval: 2s
237-
depends_on:
238-
security-api-test:
239-
condition: service_started
240-
241203
volumes:
242204
ubik-rabbitmq-vol:
243205
ubik-postgresl-vol:

docker-integration-tests.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,23 @@ services:
2222
condition: service_started
2323
ubik-postgres:
2424
condition: service_started
25+
healthcheck:
26+
test: ["CMD-SHELL", "curl --fail http://localhost:80/healthcheck || exit 1" ]
27+
start_period: 10s
28+
interval: 30s
29+
retries: 3
30+
timeout: 5s
31+
2532
networks:
2633
- ubik-network
2734
ports:
2835
- "5000:8080"
36+
finisher:
37+
container_name: wait-for-completion
38+
image: alpine
39+
healthcheck:
40+
test: exit 0
41+
interval: 2s
42+
depends_on:
43+
security-api-test:
44+
condition: service_started

src/Ubik.Security.Api/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@
146146
options.LowercaseUrls = true;
147147
});
148148

149+
//builder.Services.AddHealthChecks();
150+
149151
//Build the app
150152
var app = builder.Build();
151153

@@ -194,4 +196,5 @@
194196
);
195197

196198
app.MapControllers();
199+
//app.MapHealthChecks("/api/health");
197200
app.Run();

0 commit comments

Comments
 (0)