Skip to content

Commit e8b458f

Browse files
fix: add PostGIS extension and Natura2000 schema setup for tests
1 parent c869180 commit e8b458f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ jobs:
136136
run: |
137137
service postgresql start
138138
psql postgres://geoengine:geoengine@localhost -c "CREATE DATABASE biois;"
139+
psql postgres://geoengine:geoengine@localhost/biois -c "CREATE EXTENSION IF NOT EXISTS postgis;"
139140
- name: setup rust build cache
140141
uses: Swatinem/rust-cache@v2
141142
with:

backend/src/processes/habitat_distance.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,23 @@ mod tests {
375375
#[tokio::test(flavor = "multi_thread")]
376376
async fn process_summary_has_expected_inputs_and_outputs() {
377377
let pool = mock_db_pool().await;
378+
379+
// create schema / table and insert a test site
380+
{
381+
let mut conn = pool.get().await.unwrap();
382+
conn.batch_execute(&indoc::formatdoc! {"
383+
CREATE SCHEMA IF NOT EXISTS \"Natura2000\";
384+
CREATE TABLE IF NOT EXISTS \"Natura2000\".naturasite_polygon (
385+
sitecode TEXT,
386+
sitename TEXT,
387+
geom geometry
388+
);
389+
"
390+
})
391+
.await
392+
.unwrap();
393+
}
394+
378395
let p = HabitatDistanceProcess::new(pool).await.unwrap();
379396
let process = p.process().expect("to produce process description");
380397

0 commit comments

Comments
 (0)