Skip to content

Commit 2f8652f

Browse files
committed
Improve testing
1 parent b48e45b commit 2f8652f

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- name: Build image
2323
run: |
24-
make build
24+
make build-with-cache
2525
2626
- name: Tests
2727
run: |

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ build:
1010
build-quick:
1111
docker build -t $(IMAGE_NAME):$(TAG) .
1212

13+
build-with-cache:
14+
# Used by CI to speed up build and test process
15+
docker pull $(IMAGE_NAME):$(TAG)
16+
docker build -t $(IMAGE_NAME):$(TAG) --cache-from $(IMAGE_NAME):$(TAG) .
17+
1318
test:
1419
bats -r tests/
1520

tests/create-user-db.bats

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ load test_functions.bash
1616
panubo/postgres-toolbox psql -- -c 'SELECT current_database();'
1717
diag "${output}"
1818
[[ "${status}" -eq 0 ]]
19+
# check the output of the second last line
20+
[[ "${lines[-2]}" = " myuser" ]]
1921
}
2022

2123
# echo "===> Test create-user-db command"

0 commit comments

Comments
 (0)