From eaa6033d5dee8bc6a5c0dce6c6756c0d8e6e9345 Mon Sep 17 00:00:00 2001 From: Kharkunov Eugene Date: Wed, 19 Jun 2024 12:34:10 +0300 Subject: [PATCH] Prepare CI for testing. Fix pass secret env to docker build. Fix maven auth. Rework docker compose file. Add mout directories with jars. Add copying jars to /app directories to further mounting. Update .gitignore. Fix extender's tests. Fix remote builder mappings. --- .github/workflows/application-build.yml | 44 +++++++++++----- .github/workflows/docker-env-build.yml | 21 ++++++-- .github/workflows/dockerimage.yml | 52 ------------------- .gitignore | 7 ++- client/build.gradle | 1 - server/build-docker.sh | 10 ---- server/build.gradle | 10 +++- server/configs/application-local-dev-app.yml | 39 ++++++-------- server/docker/Dockerfile.base-app | 10 ---- server/docker/common-services.yml | 5 ++ server/docker/docker-compose.yml | 30 +++++------ server/docker/users/testusers.txt | 1 - server/docker/users/users.txt | 1 - server/manifestmergetool/build.gradle | 12 ++++- server/scripts/start-test-server.sh | 10 ++-- server/scripts/stop-test-server.sh | 8 +-- server/src/main/resources/application.yml | 2 + .../defold/extender/AuthenticationTest.java | 5 +- .../com/defold/extender/IntegrationTest.java | 5 +- 19 files changed, 125 insertions(+), 148 deletions(-) delete mode 100644 .github/workflows/dockerimage.yml delete mode 100644 server/docker/Dockerfile.base-app delete mode 100644 server/docker/users/testusers.txt delete mode 100644 server/docker/users/users.txt diff --git a/.github/workflows/application-build.yml b/.github/workflows/application-build.yml index fd4b5626..78507086 100644 --- a/.github/workflows/application-build.yml +++ b/.github/workflows/application-build.yml @@ -1,12 +1,17 @@ name: Build jars on: + workflow_dispatch: push: tags: - "extender-v[0-9]+.[0-9]+.[0-9]+" - "client-v[0-9]+.[0-9]+.[0-9]+" - "manifestmerger-v[0-9]+.[0-9]+.[0-9]+" +env: + GOOGLE_ARTIFACT_REGISTRY: europe-north1-docker.pkg.dev + MAVEN_SERVICE_ACCOUNT: superb-chamois-registry@extender-poc.iam.gserviceaccount.com + jobs: client: if: ${{ startsWith(github.ref_name, 'client-') }} @@ -22,6 +27,13 @@ jobs: TAG_VERSION="${TAG_NAME#*-v}" echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT + - name: Login to Google Artifact registry (Maven) + uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa + with: + service_account: ${{ env.MAVEN_SERVICE_ACCOUNT }} + credentials_json: ${{ secrets.MAVEN_REGISTRY_JSON_KEY }} + export_environment_variables: true + create_credentials_file: true - name: Install Java uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 with: @@ -30,7 +42,7 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@31ae3562f68c96d481c31bc1a8a55cc1be162f83 - name: Build the extender-client.jar - run: ./gradlew -PclientVersion=${{ steps.version.outputs.tag_version }} client:build + run: ./gradlew -PclientVersion=${{ steps.version.outputs.tag_version }} client:jar - name: Test the extender-client.jar run: ./gradlew -PclientVersion=${{ steps.version.outputs.tag_version }} client:test - name: Publish to Google artifact registry @@ -42,7 +54,7 @@ jobs: ${{ github.workspace }}/gh_release/extender-client-${{ steps.version.outputs.tag_version }}.jar - name: Publish to Github release run: | - chmod 0444 ${{ github.workspace }}/*.jar + chmod 0444 ${{ github.workspace }}/gh_release/*.jar echo ${{ github.token }} | gh auth login --with-token gh release create "${GITHUB_REF_NAME}" \ --draft \ @@ -50,7 +62,7 @@ jobs: --target ${{ github.sha }} \ ${{ github.workspace }}/gh_release/*.jar - name: Notify if tests failed - uses: homoluctus/slatify@master + uses: homoluctus/slatify@cd4b4a1158cfb3e26fe1ee35c1cd4f0247dfbf96 if: failure() with: type: ${{ job.status }} @@ -72,6 +84,13 @@ jobs: TAG_VERSION="${TAG_NAME#*-v}" echo "tag_version=$TAG_VERSION" >> $GITHUB_OUTPUT + - name: Login to Google Artifact registry (Maven) + uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa + with: + service_account: ${{ env.MAVEN_SERVICE_ACCOUNT }} + credentials_json: ${{ secrets.MAVEN_REGISTRY_JSON_KEY }} + export_environment_variables: true + create_credentials_file: true - name: Install Java uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 with: @@ -92,7 +111,7 @@ jobs: ${{ github.workspace }}/gh_release/manifestmergetool-${{ steps.version.outputs.tag_version }}.jar - name: Publish to Github release run: | - chmod 0444 ${{ github.workspace }}/*.jar + chmod 0444 ${{ github.workspace }}/gh_release/*.jar echo ${{ github.token }} | gh auth login --with-token gh release create "${GITHUB_REF_NAME}" \ --draft \ @@ -100,7 +119,7 @@ jobs: --target ${{ github.sha }} \ ${{ github.workspace }}/gh_release/*.jar - name: Notify if tests failed - uses: homoluctus/slatify@master + uses: homoluctus/slatify@cd4b4a1158cfb3e26fe1ee35c1cd4f0247dfbf96 if: failure() with: type: ${{ job.status }} @@ -110,8 +129,6 @@ jobs: extender: if: ${{ startsWith(github.ref_name, 'extender-') }} - env: - GOOGLE_ARTIFACT_REGISTRY: europe-north1-docker.pkg.dev runs-on: ubuntu-latest steps: - name: Checkout repo @@ -147,11 +164,12 @@ jobs: - name: Run extender tests run: ./gradlew -PextenderVersion=${{ steps.version.outputs.tag_version }} server:test -i - name: Login to Google Artifact registry (Maven) - uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 + uses: google-github-actions/auth@71fee32a0bb7e97b4d33d548e7d957010649d8fa with: - registry: ${{ env.GOOGLE_ARTIFACT_REGISTRY }} - username: _json_key - password: ${{ secrets.MAVEN_REGISTRY_JSON_KEY }} + service_account: ${{ env.MAVEN_SERVICE_ACCOUNT }} + credentials_json: ${{ secrets.MAVEN_REGISTRY_JSON_KEY }} + export_environment_variables: true + create_credentials_file: true - name: Publish to Google artifact registry run: ./gradlew -PextenderVersion=${{ steps.version.outputs.tag_version }} publishExtenderPublicationToExtenderRepoRepository - name: Prepare jar for GH release @@ -161,7 +179,7 @@ jobs: ${{ github.workspace }}/gh_release/extender-${{ steps.version.outputs.tag_version }}.jar - name: Publish to Github release run: | - chmod 0444 ${{ github.workspace }}/*.jar + chmod 0444 ${{ github.workspace }}/gh_release/*.jar echo ${{ github.token }} | gh auth login --with-token gh release create "${GITHUB_REF_NAME}" \ --draft \ @@ -169,7 +187,7 @@ jobs: --target ${{ github.sha }} \ ${{ github.workspace }}/gh_release/*.jar - name: Notify if tests failed - uses: homoluctus/slatify@master + uses: homoluctus/slatify@cd4b4a1158cfb3e26fe1ee35c1cd4f0247dfbf96 if: failure() with: type: ${{ job.status }} diff --git a/.github/workflows/docker-env-build.yml b/.github/workflows/docker-env-build.yml index ce582048..7015b14f 100644 --- a/.github/workflows/docker-env-build.yml +++ b/.github/workflows/docker-env-build.yml @@ -1,9 +1,20 @@ name: Build Docker environment container on: + workflow_dispatch: push: tags: - - "*" + - "android*" + - "base*" + - "linux*" + - "emsdk*" + - "wine*" + - "winsdk*" + - "nssdk*" + - "ps4*" + - "ps5*" + + env: GOOGLE_ARTIFACT_REGISTRY: europe-north1-docker.pkg.dev @@ -19,9 +30,9 @@ jobs: - name: Process tag name id: name_postprocess run: | - PRIVATE_PLATFORM_LIST=${{ env.PRIVATE_PLATFORMS }} - PUBLIC_REGISTRY=${{ env.PUBLIC_REGISTRY }} - PRIVATE_REGISTRY=${{ env.PRIVATE_REGISTRY }} + PRIVATE_PLATFORM_LIST="${{ env.PRIVATE_PLATFORMS }}" + PUBLIC_REGISTRY="${{ env.PUBLIC_REGISTRY }}" + PRIVATE_REGISTRY="${{ env.PRIVATE_REGISTRY }}" SHORT_SHA="$(echo ${GITHUB_SHA} | cut -c1-8)" TAG_NAME=${{ github.ref_name }} @@ -66,7 +77,7 @@ jobs: platforms: | linux/amd64 secret-envs: | - id=DM_PACKAGES_URL + DM_PACKAGES_URL=DM_PACKAGES_URL tags: | ${{ steps.name_postprocess.outputs.target_registry }}/extender-${{ steps.name_postprocess.outputs.image_name }}-env:${{ steps.name_postprocess.outputs.image_version }} ${{ steps.name_postprocess.outputs.target_registry }}/extender-${{ steps.name_postprocess.outputs.image_name }}-env:${{ steps.name_postprocess.outputs.short_sha }} diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml deleted file mode 100644 index dc33555c..00000000 --- a/.github/workflows/dockerimage.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Docker Image CI - -on: [push, pull_request] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - - name: Install Java - uses: actions/setup-java@v3 - with: - java-version: '11.0.15' - distribution: 'temurin' - - - name: Free disk space - run: | - df -h - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - docker rmi $(docker image ls -aq) - df -h - - - name: Build the extender-client.jar - run: (cd client && ../gradlew build) - - - name: Test the extender-client.jar - run: (cd client && ../gradlew test) - - - name: Build the Docker image - run: ./server/scripts/build.sh -xtest - env: - DM_PACKAGES_URL: ${{ secrets.S3_URL }} - - - name: Test the Docker image - run: ./gradlew test -i - env: - DM_PACKAGES_URL: ${{ secrets.S3_URL }} - - - name: Notify if tests failed - uses: homoluctus/slatify@master - if: failure() - with: - type: ${{ job.status }} - job_name: 'Extender tests' - channel: '#defold-alarms-build' - url: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.gitignore b/.gitignore index db5923c7..abeba287 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,9 @@ server/test-data/sdk/* .bash_history Version.java -/server/docker/*.jar \ No newline at end of file +/server/app/* +server/bin/* +server/manifestmergetool/app/* +server/manifestmergetool/bin/* + +.vscode/* \ No newline at end of file diff --git a/client/build.gradle b/client/build.gradle index 0f0dfdac..9e1883e0 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -17,7 +17,6 @@ publishing { groupId 'com.defold.extender' artifactId 'client' version project.ext.clientVersion - from components.java } } } diff --git a/server/build-docker.sh b/server/build-docker.sh index d4ae3697..fc055208 100755 --- a/server/build-docker.sh +++ b/server/build-docker.sh @@ -3,16 +3,6 @@ set -e SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# $SCRIPT_DIR/../gradlew build -xtest -# $SCRIPT_DIR/../gradlew :manifestmergetool:mainJar - -# # copy jars -# cp $SCRIPT_DIR/build/libs/extender-0.1.0.jar $SCRIPT_DIR/docker -# cp $SCRIPT_DIR/manifestmergetool/build/libs/manifestmergetool-0.1.0.jar $SCRIPT_DIR/docker - -# # copy users -# cp -r $SCRIPT_DIR/users $SCRIPT_DIR/docker - DOCKER_REGISTRY=europe-north1-docker.pkg.dev/extender-poc/extender-public-registry DOCKER_PRIVATE_REGISTRY=europe-north1-docker.pkg.dev/extender-poc/extender-private-registry diff --git a/server/build.gradle b/server/build.gradle index 17eeaf74..69fbc46d 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -118,6 +118,15 @@ compileJava { bootJar { archiveBaseName = 'extender' version = project.ext.extenderVersion + doLast { + copy { + from "${project.projectDir}/build/libs/extender-${project.ext.extenderVersion}.jar" + into "app" + rename { String fileName -> + fileName.replace("-$project.ext.extenderVersion", "") + } + } + } } // Builds the extender server base classes into a .jar file @@ -134,7 +143,6 @@ publishing { groupId 'com.defold.extender' artifactId 'server' version project.ext.extenderVersion - from components.java } } } diff --git a/server/configs/application-local-dev-app.yml b/server/configs/application-local-dev-app.yml index 369ee733..c2f8b324 100644 --- a/server/configs/application-local-dev-app.yml +++ b/server/configs/application-local-dev-app.yml @@ -2,27 +2,20 @@ extender: remote-builder: enabled: true platforms: - android-ndk25: http://android_ndk25:9000 - android-latest: http://android_ndk25:9000 - emsdk-2011: http://emscripten_2011:9000 - emsdk-3155: http://emscripten_3155:9000 - emsdk-latest: http://emscripten_3155:9000 + android-ndk25: http://android-ndk25:9000 + android-latest: http://android-ndk25:9000 + emsdk-2011: http://emsdk-2011:9000 + emsdk-3155: http://emsdk-3155:9000 + emsdk-latest: http://emsdk-3155:9000 linux-latest: http://linux:9000 - nssdk-1532: http://nssdk_1532:9000 - nssdk-1753: http://nssdk_1753:9000 - nssdk-latest: http://nssdk_1753:9000 - ps4-10500: http://ps4_10500:9000 - ps4-11000: http://ps4_11000:9000 - ps4-latest: http://ps4_11000:9000 - ps5-8000: http://ps5_8000:9000 - ps5-latest: http://ps5_8000:9000 - winsdk-2019: http://win_2019:9000 - winsdk-2022: http://win_2022:9000 - winsdk-latest: http://win_2022:9000 - -spring: - servlet: - multipart: - enabled: true - max-file-size: 512MB - max-request-size: 512MB \ No newline at end of file + nssdk-1532: http://nssdk-1532:9000 + nssdk-1753: http://nssdk-1753:9000 + nssdk-latest: http://nssdk-1753:9000 + ps4-10500: http://ps4-10500:9000 + ps4-11000: http://ps4-11000:9000 + ps4-latest: http://ps4-11000:9000 + ps5-8000: http://ps5-8000:9000 + ps5-latest: http://ps5-8000:9000 + winsdk-2019: http://winsdk-2019:9000 + winsdk-2022: http://winsdk-2022:9000 + winsdk-latest: http://winsdk-2022:9000 \ No newline at end of file diff --git a/server/docker/Dockerfile.base-app b/server/docker/Dockerfile.base-app deleted file mode 100644 index 37487ab4..00000000 --- a/server/docker/Dockerfile.base-app +++ /dev/null @@ -1,10 +0,0 @@ -FROM europe-north1-docker.pkg.dev/extender-poc/extender-public-registry/extender-base-env - -COPY users/ users/ -ADD extender-0.1.0.jar app.jar -ADD manifestmergetool-0.1.0.jar $MANIFEST_MERGE_TOOL - -RUN chown extender: app.jar - -USER extender -ENTRYPOINT ["java","-Xmx2g","-XX:MaxDirectMemorySize=1g","-jar","/app.jar"] diff --git a/server/docker/common-services.yml b/server/docker/common-services.yml index d0dc15a1..8e0f6975 100644 --- a/server/docker/common-services.yml +++ b/server/docker/common-services.yml @@ -2,14 +2,19 @@ services: test_builder: platform: linux/amd64 volumes: + - ./../app/:/app/:ro - ./../configs:/etc/defold/extender:ro - ./../test-data/sdk:/var/extender/sdk + entrypoint: ["java","-Xmx4g","-XX:MaxDirectMemorySize=2g","-jar","/app/extender.jar"] environment: - EXAMPLE_VAR=1 common_builder: platform: linux/amd64 volumes: + - ./../app/:/app/:ro + - ./../manifestmergetool/app/:/opt/local/bin/:ro - ./../configs:/etc/defold/extender:ro + entrypoint: ["java","-Xmx4g","-XX:MaxDirectMemorySize=2g","-jar","/app/extender.jar"] environment: - EXAMPLE_VAR=1 # - DM_DEBUG_COMMANDS=1 diff --git a/server/docker/docker-compose.yml b/server/docker/docker-compose.yml index 172a549b..27711c6f 100644 --- a/server/docker/docker-compose.yml +++ b/server/docker/docker-compose.yml @@ -48,7 +48,7 @@ services: networks: default: aliases: - - android_ndk25 + - android-ndk25 emscripten_2011-dev: image: europe-north1-docker.pkg.dev/extender-poc/extender-public-registry/extender-emsdk-2011-env:latest extends: @@ -60,7 +60,7 @@ services: networks: default: aliases: - - emscripten_2011 + - emscripten-2011 emscripten_3155-dev: image: europe-north1-docker.pkg.dev/extender-poc/extender-public-registry/extender-emsdk-3155-env:latest extends: @@ -72,7 +72,7 @@ services: networks: default: aliases: - - emscripten_3155 + - emscripten-3155 nssdk_1532-dev: image: europe-north1-docker.pkg.dev/extender-poc/extender-private-registry/extender-nssdk-1532-env:latest extends: @@ -85,7 +85,7 @@ services: networks: default: aliases: - - nssdk_1532 + - nssdk-1532 nssdk_1753-dev: image: europe-north1-docker.pkg.dev/extender-poc/extender-private-registry/extender-nssdk-1753-env:latest extends: @@ -98,7 +98,7 @@ services: networks: default: aliases: - - nssdk_1753 + - nssdk-1753 ps4_11000-dev: image: europe-north1-docker.pkg.dev/extender-poc/extender-private-registry/extender-ps4-11000-env:latest extends: @@ -111,7 +111,7 @@ services: networks: default: aliases: - - ps4_11000 + - ps4-11000 ps4_10500-dev: image: europe-north1-docker.pkg.dev/extender-poc/extender-private-registry/extender-ps4-10500-env:latest extends: @@ -124,7 +124,7 @@ services: networks: default: aliases: - - ps4_10500 + - ps4-10500 ps5_8000-dev: image: europe-north1-docker.pkg.dev/extender-poc/extender-private-registry/extender-ps5-8000-env:latest extends: @@ -137,7 +137,7 @@ services: networks: default: aliases: - - ps5_8000 + - ps5-8000 win_2019-dev: image: europe-north1-docker.pkg.dev/extender-poc/extender-public-registry/extender-winsdk-2019-env:latest extends: @@ -149,7 +149,7 @@ services: networks: default: aliases: - - win_2019 + - winsdk-2019 win_2022-dev: image: europe-north1-docker.pkg.dev/extender-poc/extender-public-registry/extender-winsdk-2022-env:latest extends: @@ -161,7 +161,7 @@ services: networks: default: aliases: - - win_2022 + - winsdk-2022 # services for integration testing frontend-integration-test: @@ -204,7 +204,7 @@ services: networks: default: aliases: - - android_ndk25 + - android-ndk25 emscripten_2011-integration-test: image: europe-north1-docker.pkg.dev/extender-poc/extender-public-registry/extender-emsdk-2011-env:latest extends: @@ -215,7 +215,7 @@ services: networks: default: aliases: - - emscripten_2011 + - emsdk-2011 emscripten_3155-integration-test: image: europe-north1-docker.pkg.dev/extender-poc/extender-public-registry/extender-emsdk-3155-env:latest extends: @@ -226,7 +226,7 @@ services: networks: default: aliases: - - emscripten_3155 + - emsdk-3155 win_2019-integration-test: image: europe-north1-docker.pkg.dev/extender-poc/extender-public-registry/extender-winsdk-2019-env:latest extends: @@ -237,7 +237,7 @@ services: networks: default: aliases: - - win_2019 + - winsdk-2019 win_2022-integration-test: image: europe-north1-docker.pkg.dev/extender-poc/extender-public-registry/extender-winsdk-2022-env:latest extends: @@ -248,7 +248,7 @@ services: networks: default: aliases: - - win_2022 + - winsdk-2022 # linux service for auth testing frontend-auth-test: diff --git a/server/docker/users/testusers.txt b/server/docker/users/testusers.txt deleted file mode 100644 index 6d82ffdf..00000000 --- a/server/docker/users/testusers.txt +++ /dev/null @@ -1 +0,0 @@ -bobuser = bobpassword,ROLE_LINUX,enabled diff --git a/server/docker/users/users.txt b/server/docker/users/users.txt deleted file mode 100644 index 803fb4bd..00000000 --- a/server/docker/users/users.txt +++ /dev/null @@ -1 +0,0 @@ -user = password,ROLE_ANDROID,ROLE_IOS,ROLE_HTML5,ROLE_WINDOWS,ROLE_LINUX,ROLE_MACOS,ROLE_SWITCH,disabled diff --git a/server/manifestmergetool/build.gradle b/server/manifestmergetool/build.gradle index 87456d9a..d1e90f7c 100644 --- a/server/manifestmergetool/build.gradle +++ b/server/manifestmergetool/build.gradle @@ -39,16 +39,24 @@ task mainJar(type: Jar) { } duplicatesStrategy DuplicatesStrategy.WARN with jar + doLast { + copy { + from "${project.projectDir}/build/libs/manifestmergetool-${project.ext.manifestMergetoolVersion}.jar" + into "app" + rename { String fileName -> + fileName.replace("-$project.ext.manifestMergetoolVersion", "") + } + } + } } publishing { publications { manifestMergeTool(MavenPublication) { artifact mainJar - groupId 'com.defold' + groupId 'com.defold.extender' artifactId 'manifestmergetool' version project.ext.manifestMergetoolVersion - from components.java } } } diff --git a/server/scripts/start-test-server.sh b/server/scripts/start-test-server.sh index 5c984c33..1e41ada6 100755 --- a/server/scripts/start-test-server.sh +++ b/server/scripts/start-test-server.sh @@ -3,8 +3,6 @@ set -e set -x -APPLICATION=extender - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" PORT=9000 @@ -13,8 +11,14 @@ if [ "$COMPOSE_PROFILE" == "" ]; then COMPOSE_PROFILE="test" fi +if [ "$APPLICATION" == "" ]; then + APPLICATION="extender-test" +fi + + echo "Using RUN_ENV: ${RUN_ENV}" echo "Using compose profile: ${COMPOSE_PROFILE}" +echo "Start application: ${APPLICATION}" echo "Using PORT: ${PORT}" URL=http://localhost:${PORT} @@ -29,8 +33,6 @@ function check_server() { # fail early check_server -DM_PACKAGES_URL=${DM_PACKAGES_URL} ${DIR}/../build-docker.sh - # For CI to be able to work with the test files if [ "$GITHUB_ACTION" != "" ]; then chmod -R a+xrw ${DIR}/../test-data || true diff --git a/server/scripts/stop-test-server.sh b/server/scripts/stop-test-server.sh index 61843855..2fc30a3f 100755 --- a/server/scripts/stop-test-server.sh +++ b/server/scripts/stop-test-server.sh @@ -1,12 +1,14 @@ #!/usr/bin/env bash -APPLICATION=extender +if [ "$APPLICATION" == "" ]; then + APPLICATION="extender-test" +fi # echo "stop-test-server.sh: Output log result for ${CONTAINER}:" # docker logs ${CONTAINER} -echo "stop-test-server.sh: Stopping ${CONTAINER}:" +echo "stop-test-server.sh: Stopping ${APPLICATION}:" docker compose -p $APPLICATION down # docker stop ${CONTAINER} @@ -18,4 +20,4 @@ docker compose -p $APPLICATION down # sleep 1 # done -echo "stop-test-server.sh: Test server ${CONTAINER} exited" +echo "stop-test-server.sh: Test server ${APPLICATION} exited" diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml index 57ab8970..882cdd43 100644 --- a/server/src/main/resources/application.yml +++ b/server/src/main/resources/application.yml @@ -70,5 +70,7 @@ management: metrics: export: + stackdriver: + enabled: false influx: enabled: false diff --git a/server/src/test/java/com/defold/extender/AuthenticationTest.java b/server/src/test/java/com/defold/extender/AuthenticationTest.java index 3c55a582..2ff7a317 100644 --- a/server/src/test/java/com/defold/extender/AuthenticationTest.java +++ b/server/src/test/java/com/defold/extender/AuthenticationTest.java @@ -26,8 +26,6 @@ public class AuthenticationTest { private long startTime; - private static final String DM_PACKAGES_URL = System.getenv("DM_PACKAGES_URL"); - private static final List SOURCE_FILES = Lists.newArrayList( new FileExtenderResource("test-data/AndroidManifest.xml", "AndroidManifest.xml"), new FileExtenderResource("test-data/ext_basic/ext.manifest"), @@ -49,8 +47,8 @@ public AuthenticationTest() {} @BeforeClass public static void beforeClass() throws IOException, InterruptedException { ProcessExecutor processExecutor = new ProcessExecutor(); - processExecutor.putEnv("DM_PACKAGES_URL", AuthenticationTest.DM_PACKAGES_URL); processExecutor.putEnv("COMPOSE_PROFILE", "auth-test"); + processExecutor.putEnv("APPLICATION", "extender-test-auth"); processExecutor.execute("scripts/start-test-server.sh"); System.out.println(processExecutor.getOutput()); @@ -80,6 +78,7 @@ public static void beforeClass() throws IOException, InterruptedException { @AfterClass public static void afterClass() throws IOException, InterruptedException { ProcessExecutor processExecutor = new ProcessExecutor(); + processExecutor.putEnv("APPLICATION", "extender-test-auth"); processExecutor.execute("scripts/stop-test-server.sh"); System.out.println(processExecutor.getOutput()); } diff --git a/server/src/test/java/com/defold/extender/IntegrationTest.java b/server/src/test/java/com/defold/extender/IntegrationTest.java index d22b0764..6b97e556 100644 --- a/server/src/test/java/com/defold/extender/IntegrationTest.java +++ b/server/src/test/java/com/defold/extender/IntegrationTest.java @@ -35,8 +35,6 @@ public class IntegrationTest { private TestConfiguration configuration; private long startTime; - private static final String DM_PACKAGES_URL = System.getenv("DM_PACKAGES_URL"); - @Rule public TestName name = new TestName(); @@ -160,8 +158,8 @@ public IntegrationTest(TestConfiguration configuration) { @BeforeClass public static void beforeClass() throws IOException, InterruptedException { ProcessExecutor processExecutor = new ProcessExecutor(); - processExecutor.putEnv("DM_PACKAGES_URL", IntegrationTest.DM_PACKAGES_URL); processExecutor.putEnv("COMPOSE_PROFILE", "test"); + processExecutor.putEnv("APPLICATION", "extender-test"); processExecutor.execute("scripts/start-test-server.sh"); System.out.println(processExecutor.getOutput()); @@ -193,6 +191,7 @@ public static void beforeClass() throws IOException, InterruptedException { @AfterClass public static void afterClass() throws IOException, InterruptedException { ProcessExecutor processExecutor = new ProcessExecutor(); + processExecutor.putEnv("APPLICATION", "extender-test"); processExecutor.execute("scripts/stop-test-server.sh"); System.out.println(processExecutor.getOutput()); }