firebase-functions-test icon indicating copy to clipboard operation
firebase-functions-test copied to clipboard

Using WIF token when testing

Open JvandeKraats opened this issue 1 year ago • 1 comments
trafficstars

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/[email protected]
        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.

JvandeKraats avatar Jul 03 '24 12:07 JvandeKraats