-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run Azure blob store integration tests with Azure and Azurite
Azurite is run as a testcontainer, and the github CI build runs all integration tests for Java 11, 17, and 21. In order to save on Azure resources, online integration tests are run only if the Azurite based tests succeeded, using github secrets to set up the account, key, and container; and for Java 11 only.
- Loading branch information
Showing
23 changed files
with
1,172 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Azure BlobStore Integration | ||
|
||
on: | ||
push: | ||
tags: | ||
- "**" | ||
pull_request: | ||
paths: | ||
- ".github/workflows/azure-integration.yml" | ||
- "pom.xml" | ||
- "geowebcache/pom.xml" | ||
- "geowebcache/core/**" | ||
- "geowebcache/azureblob/**" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
azurite: | ||
name: Azurite container | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java-version: [ 11, 17, 21 ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: ${{ matrix.java-version }} | ||
cache: 'maven' | ||
|
||
- name: Tests against Azurite TestContainers | ||
#-PexcludeOnlineTests includes Azurite container tests and excludes Azure online tests | ||
run: | | ||
mvn verify -f geowebcache/pom.xml -pl :gwc-azure-blob -am \ | ||
-Ponline,excludeAzureOnlineTests \ | ||
-DskipTests=true \ | ||
-DskipITs=false -B -ntp | ||
- name: Remove SNAPSHOT jars from repository | ||
run: | | ||
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {} | ||
azure: | ||
name: Azure online | ||
#if: github.repository == 'geowebcache/geowebcache' | ||
runs-on: ubuntu-latest | ||
needs: azurite | ||
if: | | ||
always() && | ||
!contains(needs.*.result, 'cancelled') && | ||
!contains(needs.*.result, 'failure') | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 11 | ||
cache: 'maven' | ||
|
||
- name: Tests against Azure | ||
env: | ||
azure_account: ${{ secrets.AZURE_ACCOUNT }} | ||
azure_account_key: ${{ secrets.AZURE_ACCOUNT_KEY }} | ||
azure_container: ${{ secrets.AZURE_CONTAINER }} | ||
if: ${{ env.azure_account != null }} && ${{ env.azure_account_key != null }} | ||
run: | #-PexcludeDockerTests includes Azure online tests and excludes Azurite container tests | ||
echo "accountName=$azure_account" > $HOME/.gwc_azure_tests.properties | ||
echo "accountKey=$azure_account_key" >> $HOME/.gwc_azure_tests.properties | ||
echo "container=$azure_container" >> $HOME/.gwc_azure_tests.properties | ||
echo 'maxConnections=8' >> $HOME/.gwc_azure_tests.properties | ||
echo 'useHTTPS=true' >> $HOME/.gwc_azure_tests.properties | ||
mvn verify -f geowebcache/pom.xml -pl :gwc-azure-blob -am \ | ||
-Ponline,excludeDockerTests \ | ||
-DskipTests=true \ | ||
-DskipITs=false -B -ntp | ||
- name: Remove SNAPSHOT jars from repository | ||
run: | | ||
find .m2/repository -name "*SNAPSHOT*" -type d | xargs rm -rf {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Azure BlobStore | ||
|
||
GeoWebCache `BlobStore` implementation to store tiles on [Azure Blob Storage](https://azure.microsoft.com/en-us/products/storage/blobs) | ||
|
||
|
||
## Building | ||
|
||
`mvn install|test|verify` will run only unit tests. | ||
|
||
In order to run the integration tests, build with the `-Ponline` maven profile. For example: | ||
|
||
``` | ||
mvn verify -Ponline | ||
``` | ||
|
||
There are two sets of integration tests: | ||
|
||
- `org.geowebcache.azure.tests.container.*IT.java`: run integration tests using [Testcontainers](https://testcontainers.com/), with a Microsoft [Azurite](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite) Docker image. | ||
- `org.geowebcache.azure.tests.online.*IT.java`: run integration tests against a real Azure account, only if there's a configuration file in `$HOME/.gwc_azure_tests.properties`, which must have the following contents: | ||
|
||
``` | ||
accountName=<Azure account name> | ||
accountKey=<Azure account key> | ||
container=<Azure blob storage container name> | ||
useHTTPS=true | ||
maxConnections=<optional, max number of concurrent connections> | ||
``` | ||
|
||
## Continuous integration | ||
|
||
There's a Github Actions CI job defined at `<gwc git root>/.github/workflows/azure-integration.yml` | ||
that will run the Docker-based integration tests first, and then the online ones against | ||
a real Azure account, using Github repository secrets to define the values for the | ||
`$HOME/.gwc_azure_tests.properties` file's `accountName`, `accountSecret`, and `container` keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.