File tree 3 files changed +7
-10
lines changed
3 files changed +7
-10
lines changed Original file line number Diff line number Diff line change
1
+ dist : focal
1
2
language : go
2
3
go :
3
4
- 1.21.x
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ case $# in
16
16
;;
17
17
esac
18
18
19
- COMPOSE_OPTIONS=" "
20
19
case $ARG in
21
20
" read" )
22
21
CONFIG_FILE=" _resources/config/e2e-read-replica.toml"
@@ -34,17 +33,15 @@ case $ARG in
34
33
;;
35
34
esac
36
35
37
-
38
36
# Start postgress databases.
39
- docker-compose -f _resources/docker-compose-e2e.yml -p " e2e" up -d $SERVICE
37
+ docker-compose -f _resources/docker-compose-e2e.yml -p e2e up --quiet-pull -d $SERVICE
40
38
41
39
# Set up schema for the test db.
42
- set +e
43
- rm -rf /tmp/vulnerability-db
44
- set -e
45
- git clone --single-branch --branch master https://github.com/adevinta/vulnerability-db.git /tmp/vulnerability-db
46
- docker run --net=host -v /tmp/vulnerability-db/db:/flyway/sql flyway/flyway:" ${FLYWAY_VERSION:- 8} -alpine" \
40
+ VDB=$( mktemp -d)
41
+ git clone --single-branch --branch master https://github.com/adevinta/vulnerability-db.git " $VDB "
42
+ docker run --net=host -v " $VDB /db/sql" :/flyway/sql flyway/flyway:" ${FLYWAY_VERSION:- 10} -alpine" \
47
43
-user=vulndb -password=vulndb -url=jdbc:postgresql://127.0.0.1:5434/vulndbtest -baselineOnMigrate=true migrate
44
+ rm -rf " $VDB "
48
45
49
46
# Loaf fixtures in the test db.
50
47
TestDBPort=5434 go run e2e/fixtures.go _resources/e2e/fixtures/
70
67
pkill vulnerability-db-api
71
68
set -e
72
69
docker-compose -f _resources/docker-compose-e2e.yml -p " e2e" rm -s -f -v
73
-
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ func LoadFixtures(fixturesDir string) error {
48
48
defer db .Close () // nolint: errcheck
49
49
50
50
// Mock current time to ensure consistent exposure calculations.
51
- _ , err = db .Exec (`CREATE SCHEMA mock;` )
51
+ _ , err = db .Exec (`CREATE SCHEMA IF NOT EXISTS mock;` )
52
52
if err != nil {
53
53
return err
54
54
}
You can’t perform that action at this time.
0 commit comments