forked from cachethq/Docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.full.bats
More file actions
executable file
·59 lines (47 loc) · 1.76 KB
/
test.full.bats
File metadata and controls
executable file
·59 lines (47 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bats
load test_helpers
load docker_helpers
load "lib/batslib"
load "lib/output"
@test "[$TEST_FILE] testing Cachet Docker image build" {
command docker-compose build --no-cache cachet
}
@test "[$TEST_FILE] testing Cachet docker-compose up" {
command docker-compose up -d
}
@test "[$TEST_FILE] check for nginx startup" {
docker_wait_for_log docker_cachet_1 15 "INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)"
}
@test "[$TEST_FILE] check for php-fpm startup" {
docker_wait_for_log docker_cachet_1 15 "INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)"
}
@test "[$TEST_FILE] check for postgres startup" {
docker_wait_for_log docker_postgres_1 15 "LOG: autovacuum launcher started"
}
@test "[$TEST_FILE] php artisan cachet:seed" {
run docker exec docker_cachet_1 php artisan cachet:seed
assert_output -l 0 $'Database seeded with demo data successfully!'
}
@test "[$TEST_FILE] curl 200 response test" {
run curl_container docker_cachet_1 /auth/login --head
assert_output -l 0 $'HTTP/1.1 200 OK\r'
}
@test "[$TEST_FILE] login test" {
run curl_container docker_cachet_1 /auth/login --head --user test:test123
assert_output -l 0 $'HTTP/1.1 200 OK\r'
}
@test "[$TEST_FILE] curl API ping" {
run curl_container docker_cachet_1 /api/v1/ping
assert_output -l 0 $'{"data":"Pong!"}'
}
@test "[$TEST_FILE] check for pg_dump version mismatch" {
run docker exec docker_cachet_1 php artisan app:update
refute_output -l 5 $'pg_dump: aborting because of server version mismatch'
}
@test "[$TEST_FILE] stop all test containers" {
stop_bats_containers
}
@test "[$TEST_FILE] Cleanup test containers" {
docker_clean docker_cachet_1
docker_clean docker_postgres_1
}