From 87c3e709b18ccc1bdb9390dcc6ba845966528b6a Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Fri, 21 May 2021 13:35:56 +1200 Subject: [PATCH 1/3] docs: Clarify synopsis --- test.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test.bash b/test.bash index 32e1896..3b0eea5 100755 --- a/test.bash +++ b/test.bash @@ -4,7 +4,8 @@ set -o errexit -o nounset usage() { cat >&2 << 'EOF' -./test.bash "$ldi_linz_key" "$ldi_mfe_key" "$ldi_nzdf_key" "$ldi_basemaps_key" +Synopsis: ./test.bash "$ldi_linz_key" "$ldi_mfe_key" "$ldi_nzdf_key" "$ldi_basemaps_key" +Example: ./test.bash a1 b2 c3 d4 EOF } From c713831aac6700e86bfbb600e944f357cdcd17f0 Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Fri, 21 May 2021 13:38:54 +1200 Subject: [PATCH 2/3] tests: Run with all QGIS 3 LTR images --- .github/workflows/ci.yml | 10 +++++++++- README.md | 4 ++-- test.bash | 18 ++++++++++-------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 560b43e..f8afc79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,13 @@ jobs: test: name: test runs-on: ubuntu-20.04 + strategy: + matrix: + qgis: + - latest + - release-3_16 + - release-3_10 + - release-3_4 env: LDI_LINZ_KEY: ${{ secrets.LDI_LINZ_KEY }} LDI_MFE_KEY: ${{ secrets.LDI_MFE_KEY }} @@ -23,7 +30,8 @@ jobs: steps: - uses: actions/checkout@v2 - name: Run test script - run: ./test.bash "$LDI_LINZ_KEY" "$LDI_MFE_KEY" "$LDI_NZDF_KEY" "$LDI_BASEMAPS_KEY" + run: | + ./test.bash "${{ matrix.qgis }}" "$LDI_LINZ_KEY" "$LDI_MFE_KEY" "$LDI_NZDF_KEY" "$LDI_BASEMAPS_KEY" deploy: diff --git a/README.md b/README.md index 7dfcffa..54bbfec 100644 --- a/README.md +++ b/README.md @@ -88,9 +88,9 @@ Please see the [LINZ-Data-Importer](https://github.com/linz/linz-data-importer/) are executed via [GitHub Actions](https://github.com/linz/linz-data-importer/actions) for branches listed in the [`ci.yml`](https://github.com/linz/linz-data-importer/blob/master_qgis3/.github/workflows/ci.yml) file. These tests are against an instance of QGIS within a Docker container as made possible by the -[elpaso's Docker container](https://hub.docker.com/r/elpaso/qgis-testing-environment). +[official Docker container](https://hub.docker.com/r/qgis/qgis). -You can run the tests using the test.bash script: `./test.bash LDI_LINZ_KEY LDI_MFE_KEY LDI_NZDF_KEY LDI_BASEMAPS_KEY`. You can request the keys in these places: +You can run the tests using the test.bash script: `./test.bash QGIS_VERSION LDI_LINZ_KEY LDI_MFE_KEY LDI_NZDF_KEY LDI_BASEMAPS_KEY`. The QGIS version is one of the [official Docker image tags](https://hub.docker.com/r/qgis/qgis/tags). You can request the keys in these places: - [LDI_LINZ_KEY](https://data.linz.govt.nz/my/api/) - [LDI_MFE_KEY](https://data.mfe.govt.nz/my/api/) diff --git a/test.bash b/test.bash index 3b0eea5..0c05738 100755 --- a/test.bash +++ b/test.bash @@ -4,8 +4,10 @@ set -o errexit -o nounset usage() { cat >&2 << 'EOF' -Synopsis: ./test.bash "$ldi_linz_key" "$ldi_mfe_key" "$ldi_nzdf_key" "$ldi_basemaps_key" -Example: ./test.bash a1 b2 c3 d4 +Synopsis: ./test.bash "$qgis_version" "$ldi_linz_key" "$ldi_mfe_key" "$ldi_nzdf_key" "$ldi_basemaps_key" +Example: ./test.bash latest a1 b2 c3 d4 + +The QGIS version has to be one of the official QGIS Docker image tags . EOF } @@ -31,19 +33,19 @@ do esac done -if [[ $# -ne 4 ]] +if [[ $# -ne 5 ]] then usage exit 2 fi -export LDI_LINZ_KEY="$1" -export LDI_MFE_KEY="$2" -export LDI_NZDF_KEY="$3" -export LDI_BASEMAPS_KEY="$4" +qgis_version_tag="$1" +export LDI_LINZ_KEY="$2" +export LDI_MFE_KEY="$3" +export LDI_NZDF_KEY="$4" +export LDI_BASEMAPS_KEY="$5" image='qgis/qgis' -qgis_version_tag='latest' plugin_name='linz-data-importer' image_name="${image}:${qgis_version_tag}" container_name="${image/\//-}-${qgis_version_tag}" From 037e8c33e27ebff243cf233dccd5f5ae67dcd5cd Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Fri, 21 May 2021 14:20:01 +1200 Subject: [PATCH 3/3] tests: Run all tests to the end even if one fails Gives more useful information in case the code is incompatible with only some versions of QGIS. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8afc79..a1a1fcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: name: test runs-on: ubuntu-20.04 strategy: + fail-fast: false matrix: qgis: - latest