Skip to content

Commit 45c5e1c

Browse files
committed
run the tests in a ci pipeline
1 parent 603f59f commit 45c5e1c

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Visits API CI CD
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '*'
9+
10+
jobs:
11+
build-test-deploy:
12+
name: Build and test
13+
runs-on: ubuntu-latest
14+
services:
15+
postgres:
16+
image: ethangarofolo/messagedb
17+
ports:
18+
# will assign a random free host port
19+
- 5432:5432
20+
# needed because the postgres container does not provide a healthcheck
21+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: '7.0.x'
29+
30+
- name: Install dependencies
31+
run: dotnet restore
32+
33+
- name: Run Tests
34+
run: dotnet test Propulsion.sln --no-restore --verbosity minimal

Propulsion.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".project", ".project", "{6E
1717
LICENSE = LICENSE
1818
README.md = README.md
1919
SECURITY.md = SECURITY.md
20+
.github\workflows\ci.yaml = .github\workflows\ci.yaml
2021
EndProjectSection
2122
EndProject
2223
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Propulsion", "src\Propulsion\Propulsion.fsproj", "{0F72360F-1C14-46E3-9A60-B6BF87BD726D}"

tests/Propulsion.MessageDb.Integration/Tests.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let createStreamMessage streamName =
2828
cmd
2929

3030
[<Literal>]
31-
let ConnectionString = "Host=localhost; Port=5433; Username=message_store; Password=;"
31+
let ConnectionString = "Host=localhost; Port=5432; Username=message_store; Password=;"
3232

3333
let connect () = task {
3434
let conn = new NpgsqlConnection(ConnectionString)
@@ -54,7 +54,7 @@ let stats log = { new Propulsion.Streams.Stats<_>(log, TimeSpan.FromMinutes 1, T
5454
member _.HandleExn(log, x) = () }
5555

5656
let makeCheckpoints consumerGroup = task {
57-
let checkpoints = ReaderCheckpoint.CheckpointStore("Host=localhost; Database=message_store; Port=5433; Username=postgres; Password=postgres", "public", $"TestGroup{consumerGroup}", TimeSpan.FromSeconds 10)
57+
let checkpoints = ReaderCheckpoint.CheckpointStore("Host=localhost; Database=message_store; Port=5432; Username=postgres; Password=postgres", "public", $"TestGroup{consumerGroup}", TimeSpan.FromSeconds 10)
5858
do! checkpoints.CreateSchemaIfNotExists()
5959
return checkpoints }
6060

0 commit comments

Comments
 (0)