Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.

Commit c4c1e64

Browse files
authored
Merge pull request #51 from rostikts/fix_pg_tests_run_on_ci
add cache clean before test run
2 parents 7713da1 + 197e271 commit c4c1e64

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

.gh-actions-env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
APP_ENV=dev
22
APP_SECRET=a-very-long-key-should-be-32long
3-
DATABASE_URL=mongodb://localhost:27017
4-
DATA_STORE=mongo
3+
DATABASE_URL=user=postgres password=postgres dbname=postgres sslmode=disable
4+
DATA_STORE=pg
55
JWT_SECRET=changeMe
66
MAIL_PROVIDER=dev
77
STORAGE_PROVIDER=local

.github/workflows/go.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,28 @@ jobs:
1616
- name: Install dependencies for chromedp
1717
run: sudo apt-get install -y libnspr4 libnss3 libexpat1 libfontconfig1 libuuid1
1818

19-
2019
- name: Start containers (PostgreSQL, MongoDB, Redis)
2120
run: docker-compose -f "docker-compose-unittest.yml" up -d
2221

2322
- name: Set up Go
2423
uses: actions/setup-go@v2
2524
with:
2625
go-version: 1.18
27-
28-
- name: Setup .env file (mongo)
26+
27+
- name: Setup .env file (PostgreSQL)
2928
run: mv .gh-actions-env .env
3029

3130
- name: Build
3231
run: make build
3332

34-
- name: Test (Mongo data store)
33+
- name: Test (PostgreSQL data store)
3534
run: make alltest
36-
37-
- name: Change DATA_STORE to PostgreSQL
38-
run: sed -i 's/DATA_STORE=mongo/DATA_STORE=pg/g' .env
39-
40-
- name: Change DATABASE_URL to PG connection string
41-
run: sed -i 's/DATABASE_URL=mongodb:\/\/localhost:27017/DATABASE_URL=user=postgres password=postgres dbname=postgres sslmode=disable/g' .env
4235

43-
- name: Test (PostgreSQL data store)
36+
- name: Change DATA_STORE to Mongo
37+
run: sed -i 's/DATA_STORE=pg/DATA_STORE=mongo/g' .env
38+
39+
- name: Change DATABASE_URL to Mongo connection string
40+
run: sed -i 's/DATABASE_URL=user=postgres password=postgres dbname=postgres sslmode=disable/DATABASE_URL=mongodb:\/\/localhost:27017/g' .env
41+
42+
- name: Test (Mongo data store)
4443
run: make alltest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ deploy: build
1717
scp -qr ./sql/* sb-poc:/home/dstpierre/sql/
1818

1919
alltest:
20-
@go test --race --cover ./...
20+
@go clean -testcache && go test --race --cover ./...
2121

2222
thistest:
2323
go test -run $(TESTNAME) --cover ./...

0 commit comments

Comments
 (0)