Skip to content

Commit 09a57af

Browse files
committed
Merge branch 'master' into dependabot/pip/django-allauth-65.12.1
2 parents d0e343d + 16110e7 commit 09a57af

File tree

48 files changed

+1115
-848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1115
-848
lines changed

.circleci/config.yml

Lines changed: 0 additions & 185 deletions
This file was deleted.

.env_test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ NGINX_BASE_URL=http://localhost
6464
# port where the server can be reached on HTTPS
6565
HTTP_HOST=localhost
6666
HTTPS_HOST=
67-
POSTGRESQL_MAX_CONNECTIONS=100
67+
POSTGRESQL_MAX_CONNECTIONS=500
6868
HTTP_PORT=8000
6969
HTTPS_PORT=443
7070

.github/dependabot.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ updates:
1111
ignore:
1212
- dependency-name: django
1313
versions:
14-
- "<= 4.0"
15-
- ">= 5.0"
14+
- "<= 5.0"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Run GeoNode Test Suite
2+
on:
3+
workflow_call:
4+
inputs:
5+
suite_name:
6+
required: true
7+
type: string
8+
test_command:
9+
required: true
10+
type: string
11+
12+
jobs:
13+
run_suite:
14+
name: ${{ inputs.suite_name }}
15+
runs-on: ubuntu-24.04
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Download built Docker images
22+
uses: actions/download-artifact@v4
23+
with:
24+
name: docker-images
25+
path: docker_images
26+
27+
- name: Load Docker images
28+
run: docker load -i docker_images/django.tar
29+
30+
- name: Start the stack
31+
run: docker compose --env-file .env_test -f docker-compose-test.yml up -d
32+
33+
- name: Setup test databases
34+
run: |
35+
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();"
36+
docker compose --env-file .env_test -f docker-compose-test.yml exec db createdb -U postgres -T postgres test_postgres
37+
docker compose --env-file .env_test -f docker-compose-test.yml exec db createdb -U postgres -T postgres test_geonode
38+
docker compose --env-file .env_test -f docker-compose-test.yml exec db createdb -U postgres -T postgres test_geonode_data
39+
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;"
40+
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;"
41+
42+
- name: Run ${{ inputs.suite_name }}
43+
run: |
44+
docker compose --env-file .env_test -f docker-compose-test.yml exec -T django bash -s <<'BASH'
45+
set -euo pipefail
46+
${{ inputs.test_command }}
47+
BASH
48+
49+
- name: Codecov
50+
run: |
51+
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"
52+
53+
- name: Stop the stack
54+
if: always()
55+
run: docker compose --env-file .env_test -f docker-compose-test.yml down -v

.github/workflows/tests.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: GeoNode Test Suites
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
workflow_dispatch:
7+
8+
jobs:
9+
# -------------------------------------------------
10+
# BUILD DOCKER IMAGES AND SHARE AS ARTIFACTS
11+
# -------------------------------------------------
12+
build_images:
13+
name: Build and export Docker images
14+
runs-on: ubuntu-24.04
15+
if: ${{ github.event.pull_request.user.login != 'dependabot[bot]' && !github.event.pull_request.draft }}
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Build all services (Docker Compose v2)
22+
run: docker compose --env-file .env_test -f docker-compose-test.yml build --progress plain
23+
24+
- name: Save built Docker images
25+
run: |
26+
mkdir -p docker_images
27+
docker save -o docker_images/django.tar geonode/geonode:latest-ubuntu-24.04
28+
29+
- name: Upload Docker images as artifact
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: docker-images
33+
path: docker_images
34+
retention-days: 1
35+
36+
# -------------------------------------------------
37+
# REUSABLE WORKFLOW INVOCATIONS
38+
# -------------------------------------------------
39+
smoke:
40+
uses: ./.github/workflows/run-test-suite.yml
41+
needs: build_images
42+
with:
43+
suite_name: "Smoke Tests"
44+
test_command: >
45+
./tests/test.sh geonode.tests.smoke geonode.tests.test_rest_api geonode.tests.test_search
46+
geonode.tests.test_utils geonode.tests.test_headers --duration=30 --failfast
47+
48+
main:
49+
uses: ./.github/workflows/run-test-suite.yml
50+
needs: [build_images, smoke]
51+
with:
52+
suite_name: "Main Tests"
53+
test_command: >
54+
TESTS=$(python -c 'import sys; from geonode import settings; print(" ".join([a + ".tests"
55+
for a in settings.GEONODE_APPS if "security" not in a and "geoserver" not in a and "upload" not in a]))') &&
56+
./tests/test.sh $TESTS --duration=30 --failfast
57+
58+
security:
59+
uses: ./.github/workflows/run-test-suite.yml
60+
needs: [build_images, smoke]
61+
with:
62+
suite_name: "Security Tests"
63+
test_command: >
64+
TESTS=$(python -c 'import sys; from geonode import settings; print(" ".join([a + ".tests"
65+
for a in settings.GEONODE_APPS if "security" in a]))') &&
66+
./tests/test.sh $TESTS --duration=30 --failfast
67+
68+
gis_backend:
69+
uses: ./.github/workflows/run-test-suite.yml
70+
needs: [build_images, smoke]
71+
with:
72+
suite_name: "GIS Backend Tests"
73+
test_command: >
74+
TESTS=$(python -c 'import sys; from geonode import settings; print(" ".join([a + ".tests"
75+
for a in settings.GEONODE_APPS if "geoserver" in a]))') &&
76+
./tests/test.sh $TESTS --duration=30 --failfast
77+
78+
rest_apis:
79+
uses: ./.github/workflows/run-test-suite.yml
80+
needs: [build_images, smoke]
81+
with:
82+
suite_name: "REST API Tests"
83+
test_command: >
84+
./tests/test.sh geonode.api.tests geonode.base.api.tests geonode.layers.api.tests
85+
geonode.maps.api.tests geonode.documents.api.tests geonode.geoapps.api.tests --duration=30 --failfast
86+
87+
csw:
88+
uses: ./.github/workflows/run-test-suite.yml
89+
needs: [build_images, smoke]
90+
with:
91+
suite_name: "CSW Tests"
92+
test_command: >
93+
./tests/test.sh geonode.tests.csw geonode.catalogue.backends.tests --duration=30 --failfast
94+
95+
upload:
96+
uses: ./.github/workflows/run-test-suite.yml
97+
needs: [build_images, smoke]
98+
with:
99+
suite_name: "Upload Tests"
100+
test_command: >
101+
./tests/test.sh geonode.upload --duration=30 --failfast
102+
103+
# -------------------------------------------------
104+
# CLEANUP JOB: REMOVE ALL ARTIFACTS AT THE END
105+
# -------------------------------------------------
106+
cleanup:
107+
name: Cleanup Artifacts
108+
needs:
109+
- smoke
110+
- main
111+
- security
112+
- gis_backend
113+
- rest_apis
114+
- csw
115+
- upload
116+
runs-on: ubuntu-24.04
117+
if: always()
118+
steps:
119+
- name: Delete all uploaded artifacts
120+
uses: geekyeggo/delete-artifact@v5
121+
with:
122+
failOnError: false

0 commit comments

Comments
 (0)