diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a6627f2a2ff1..7e7b80562352 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -706,11 +706,11 @@ jobs: AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }} AWS_ACCESS_KEY_ID: ${{ vars.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }} AWS_ROLE: ${{ vars.AWS_ROLE }} AZURE_SP_TENANT: ${{ vars.AZURE_SP_TENANT }} AZURE_SP_PASSWORD: ${{ secrets.AZURE_SP_PASSWORD }} AZURE_SP_NAME: ${{ vars.AZURE_SP_NAME }} - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} steps: - uses: actions/checkout@v4 diff --git a/platforms-serverless/firebase-functions/README.md b/platforms-serverless/firebase-functions/README.md index a060dbc36cae..49dfe32e3f16 100644 --- a/platforms-serverless/firebase-functions/README.md +++ b/platforms-serverless/firebase-functions/README.md @@ -20,6 +20,6 @@ For more install methods, follow the [official install docs](https://firebase.go ### Firebase authentication -A [firebase token](https://firebase.google.com/docs/cli#cli-ci-systems) needs to be set with the environment variable `FIREBASE_TOKEN`. +A [firebase private key](https://firebase.google.com/docs/cloud-messaging/auth-server#provide-credentials-manually) needs to be set with the environment variable `FIREBASE_PRIVATE_KEY`. -If you use an interactive login using `firebase login`, you need to temporarily edit `run.sh` and remove the `--token` parameter so the firebase will use your credentials saved by `firebase login`. +If you use an interactive login using `firebase login`, you need to temporarily edit `run.sh` and remove the `GOOGLE_APPLICATION_CREDENTIALS` parameter so the firebase will use your credentials saved by `firebase login`. diff --git a/platforms-serverless/firebase-functions/finally.sh b/platforms-serverless/firebase-functions/finally.sh index 2f4d95d84d3a..7e1002c9a7db 100644 --- a/platforms-serverless/firebase-functions/finally.sh +++ b/platforms-serverless/firebase-functions/finally.sh @@ -6,7 +6,7 @@ set -eux func="$(cat func-tmp.txt)" -pnpm firebase functions:log --only "$func" +GOOGLE_APPLICATION_CREDENTIALS="./privateKey.json" pnpm firebase functions:log --only "$func" echo "full logs: https://console.firebase.google.com/project/prisma-e2e-tests-265911/functions/logs?functionFilter=$func(us-central1)&search=&severity=DEBUG" echo "project name: prisma-e2e-tests-265 911" @@ -14,6 +14,6 @@ echo "project name: prisma-e2e-tests-265 911" if [ "$TEST_EXIT_CODE" -eq "0" ]; then # If tests passed - pnpm firebase functions:delete --force "$func" + GOOGLE_APPLICATION_CREDENTIALS="./privateKey.json" pnpm firebase functions:delete --force "$func" fi \ No newline at end of file diff --git a/platforms-serverless/firebase-functions/run.sh b/platforms-serverless/firebase-functions/run.sh index 5f0b286aece4..5509fbd28d43 100644 --- a/platforms-serverless/firebase-functions/run.sh +++ b/platforms-serverless/firebase-functions/run.sh @@ -6,6 +6,7 @@ pnpm install func="e2e_firebase_test_$(date "+%Y_%m_%d_%H%M%S")" # note weird naming here echo "$func" > func-tmp.txt +echo "$FIREBASE_PRIVATE_KEY" > "./privateKey.json" # When PRISMA_CLIENT_ENGINE_TYPE is set to `binary`, overwrite existing schema file with one that sets the engineType to 'binary' if [ "$PRISMA_CLIENT_ENGINE_TYPE" == "binary" ]; then @@ -18,6 +19,6 @@ fi cd functions/ && sh prepare_in_project.sh "$func" && cd .. -pnpm firebase functions:config:set prisma.db="$DATABASE_URL" +GOOGLE_APPLICATION_CREDENTIALS="./privateKey.json" pnpm firebase functions:config:set prisma.db="$DATABASE_URL" -pnpm firebase deploy --token "$FIREBASE_TOKEN" --only "functions:$func" +GOOGLE_APPLICATION_CREDENTIALS="./privateKey.json" pnpm firebase deploy --only "functions:$func" diff --git a/platforms-serverless/firebase-functions/test.sh b/platforms-serverless/firebase-functions/test.sh index 7916a817a871..2558381774fb 100644 --- a/platforms-serverless/firebase-functions/test.sh +++ b/platforms-serverless/firebase-functions/test.sh @@ -15,9 +15,6 @@ fi expected='{"version":"'$prisma_version'","createUser":{"id":"12345","email":"alice@prisma.io","name":"Alice"},"updateUser":{"id":"12345","email":"bob@prisma.io","name":"Bob"},"users":{"id":"12345","email":"bob@prisma.io","name":"Bob"},"deleteManyUsers":{"count":1}'${files}'}' actual=$(curl "$url") -# TODO Why is this here? -pnpm firebase functions:log --only "$func" - if [ "$expected" != "$actual" ]; then echo "expected '$expected'" echo " but got '$actual'"