firebase / firebase-functions-test

MIT License
232 stars 51 forks source link

Using WIF token when testing #237

Open JvandeKraats opened 3 months ago

JvandeKraats commented 3 months ago

Version info

firebase-functions-test: v3.2.0

firebase-functions: v5.0.1

firebase-admin: v12.1.1

Test case

Steps to reproduce

When running this part of the pipeline:

- name: Install functions dependencies
   run: ....

- name: Authenticate to Google Cloud
        id: GCloudAuth
        uses: google-github-actions/auth@v2.1.3
        with:
          project_id: ....
          token_format: 'access_token'
          access_token_scopes: 'email, openid, https://www.googleapis.com/auth/cloud-platform, https://www.googleapis.com/auth/firebase, https://www.googleapis.com/auth/datastore'
          workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER_STAGING }}
          service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL_STAGING }}
          create_credentials_file: true

 - name: Setup service account key environment variable
    run: |
      echo "SERVICE_ACCOUNT_KEY=$(cat "${{ steps.GCloudAuth.outputs.credentials_file_path }}" | tr -d '\n')" >> $GITHUB_ENV

- name: Test functions
   run: npm run test:functions

I get an error while executing the tests.
This is the error I'm getting: image

Expected behavior

I expected this test package to easily leverage the WIF token to authenticate and run the tests.

Actual behavior

image

Has anyone else tried to get this working using WIF tokens?
If you're missing info, please let me know.