forked from GeoNode/geonode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
175 lines (159 loc) · 7.22 KB
/
config.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
version: 2.1
jobs:
build:
docker:
- image: cimg/base:current-22.04
parameters:
load_docker_cache:
type: boolean
save_docker_cache:
type: boolean
codecov_name:
type: string
test_suite:
type: string
default: ""
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: false
version: docker24
- run:
name: Build the stack
command: docker-compose --env-file .env_test -f docker-compose-test.yml build --no-cache
working_directory: ./
- run:
name: Start the stack
command: docker-compose --env-file .env_test -f docker-compose-test.yml up -d
working_directory: ./
- run:
name: Wait for everything to start...
command: |
n=1
m=10
until [ $n -gt $m ]
do
sleep 60
DJANGO_STATUS=$(docker inspect --format="{{json .State.Health.Status}}" django4geonode)
GEOSERVER_STATUS=$(docker inspect --format="{{json .State.Health.Status}}" geoserver4geonode)
echo ""
echo "Waited $n min (out of $m min)"
if [[ $DJANGO_STATUS == '"healthy"' ]] && [[ $GEOSERVER_STATUS == '"healthy"' ]]; then
break
fi
echo "Not healthy yet..."
docker ps
n=$[$n+1]
done
[[ $DJANGO_STATUS == '"healthy"' ]] && [[ $GEOSERVER_STATUS == '"healthy"' ]];
- run:
name: Show state (debug)
command: docker ps
when: on_fail
- run:
name: Geoserver logs (debug)
command: docker logs geoserver4geonode --tail 1000
when: on_fail
- run:
name: Django logs (debug)
command: docker logs django4geonode --tail 1000
when: on_fail
- run:
name: Celery logs (debug)
command: docker logs celery4geonode --tail 1000
when: on_fail
- when:
condition: <<parameters.test_suite>>
steps:
- run:
name: Run test suite
command: |
docker-compose --env-file .env_test -f docker-compose-test.yml exec db psql -U postgres -c 'SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid();'
docker-compose --env-file .env_test -f docker-compose-test.yml exec db createdb -U postgres -T postgres test_postgres
docker-compose --env-file .env_test -f docker-compose-test.yml exec db createdb -U postgres -T postgres test_geonode
docker-compose --env-file .env_test -f docker-compose-test.yml exec db createdb -U postgres -T postgres test_geonode_data
docker-compose --env-file .env_test -f docker-compose-test.yml exec db psql -U postgres -d test_geonode -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
docker-compose --env-file .env_test -f docker-compose-test.yml exec db psql -U postgres -d test_geonode_data -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
docker-compose --env-file .env_test -f docker-compose-test.yml exec django bash -c '<<parameters.test_suite>>'
working_directory: ./
no_output_timeout: 10m
- run:
name: Run code quality checks
command: |
docker-compose --env-file .env_test -f docker-compose-test.yml exec django bash -c ' bash <(curl -s https://codecov.io/bash) -t 2c0e7780-1640-45f0-93a3-e103b057d8c8 -F <<parameters.codecov_name>>'
working_directory: ./
workflows:
commit:
jobs:
- build:
name: geonode_test_suite_smoke
codecov_name: smoke_tests
load_docker_cache: false
save_docker_cache: false
test_suite: ./test.sh geonode.tests.smoke geonode.tests.test_message_notifications geonode.tests.test_rest_api geonode.tests.test_search geonode.tests.test_utils geonode.tests.test_headers
- build:
name: geonode_test_suite
codecov_name: main_tests
load_docker_cache: false
save_docker_cache: false
test_suite: ./test.sh $(python -c "import sys;from geonode import settings;sys.stdout.write('\'' '\''.join([a+'\''.tests'\'' for a in settings.GEONODE_APPS if '\''security'\'' not in a and '\''geoserver'\'' not in a]))") geonode.thumbs.tests geonode.people.tests geonode.people.socialaccount.providers.geonode_openid_connect.tests
- build:
name: geonode_test_security
codecov_name: security_tests
load_docker_cache: false
save_docker_cache: false
test_suite: ./test.sh $(python -c "import sys;from geonode import settings;sys.stdout.write('\'' '\''.join([a+'\''.tests'\'' for a in settings.GEONODE_APPS if '\''security'\'' in a]))")
- build:
name: geonode_test_gis_backend
codecov_name: gis
load_docker_cache: false
save_docker_cache: false
test_suite: ./test.sh $(python -c "import sys;from geonode import settings;sys.stdout.write('\'' '\''.join([a+'\''.tests'\'' for a in settings.GEONODE_APPS if '\''geoserver'\'' in a]))")
- build:
name: geonode_test_rest_apis
codecov_name: api
load_docker_cache: false
save_docker_cache: false
test_suite: ./test.sh geonode.api.tests geonode.base.api.tests geonode.layers.api.tests geonode.maps.api.tests geonode.documents.api.tests geonode.geoapps.api.tests geonode.upload.api.tests
- build:
name: geonode_test_csw
codecov_name: csw
load_docker_cache: false
save_docker_cache: false
test_suite: ./test.sh geonode.tests.csw geonode.catalogue.backends.tests
# TODO
# - build:
# name: geonode_test_integration_upload
# load_docker_cache: true
# save_docker_cache: false
# test_suite: ./test_upload.sh
# requires:
# - geonode_test_suite_smoke
# - build:
# name: tests_integration
# load_docker_cache: true
# save_docker_cache: false
# test_suite: 'geonode.tests.integration'
# requires:
# - geonode_test_suite_smoke
# - build:
# name: tests_geoserver_integration
# load_docker_cache: true
# save_docker_cache: false
# test_suite: 'geonode.geoserver.tests.integration geonode.monitoring.tests.integration'
# requires:
# - geonode_test_suite_smoke
# nightly:
# triggers:
# - schedule:
# cron: "0 0 * * *"
# filters:
# branches:
# only:
# - master
# - 3.x
# jobs:
# - build:
# load_docker_cache: false
# save_docker_cache: true
# test_suite: geonode.tests.smoke geonode.tests.integration $(python -c "import sys;from geonode import settings;sys.stdout.write('\'' '\''.join([a+'\''.tests'\'' for a in settings.GEONODE_APPS]))")