I'm getting this error running integration tests o...
# ask-ai
a
I'm getting this error running integration tests on github: /home/runner/.local/share/uv/tools/airbyte-cdk/lib/python3.11/site-packages/airbyte_cdk/test/standard_tests/source_base.py176 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /home/runner/.local/share/uv/tools/airbyte-cdk/lib/python3.11/site-packages/airbyte_cdk/test/standard_tests/declarative_sources.py82 in create_connector scenario.get_config_dict( /home/runner/.local/share/uv/tools/airbyte-cdk/lib/python3.11/site-packages/airbyte_cdk/test/models/scenario.py93 in get_config_dict yaml.safe_load(config_path.read_text()), /opt/hostedtoolcache/Python/3.11.13/x64/lib/python3.11/pathlib.py1058 in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = PosixPath('/home/runner/work/airbyte/airbyte/airbyte-integrations/connectors/source-uptick/secrets/config.json') mode = 'r', buffering = -1, encoding = 'locale', errors = None, newline = None def open(self, mode='r', buffering=-1, encoding=None, errors=None, newline=None): """ Open the file pointed by this path and return a file object, as the built-in open() function does. """ if "b" not in mode: encoding = io.text_encoding(encoding)
return io.open(self, mode, buffering, encoding, errors, newline)
E FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/airbyte/airbyte/airbyte-integrations/connectors/source-uptick/secrets/config.json' It appears my secrets are not being mounted ... what might be going wrong?
k
The error message indicates that the integration test is trying to read a secrets file at
/home/runner/work/airbyte/airbyte/airbyte-integrations/connectors/source-uptick/secrets/config.json
, but the file does not exist. This usually means that the required secret (in this case,
config.json
) was not fetched or mounted into the
secrets
directory before the test ran. Here are the most common reasons and solutions based on Airbyte documentation: 1. Secrets Not Fetched from Google Secrets Manager (GSM): - Airbyte CI and local development workflows expect secrets to be stored in GSM with specific labels and naming conventions. - The secret should be labeled with
connector: <connector-name>
and
filename: config
(without
.json
). - The CI/CD pipeline or your local environment must be configured to fetch these secrets and place them in the
secrets
directory as
config.json
before running tests. - If you are running tests locally, you can use the Airbyte CDK CLI to fetch secrets:
Copy code
bash      airbyte-cdk secrets fetch
This will save the secrets as
.json
files in the connector's
secrets
directory, making them available for testing. Make sure your environment variables
GCP_PROJECT_ID
and
GCP_GSM_CREDENTIALS
are set appropriately for authentication with GSM. 2. Connector Metadata Configuration: - Check your connector's
metadata.yaml
file. The
connectorTestSuitesOptions
section should specify the required test secrets for the integration or acceptance tests, including the correct secret name and file name (
config.json
). - Example:
Copy code
yaml      connectorTestSuitesOptions:        - suite: integrationTests          testSecrets:            - name: SECRET_SOURCE-UPTICK_CREDS              fileName: config.json              secretStore:                type: GSM                alias: airbyte-connector-testing-secret-store
- If the secret is not declared here, CI will not know to fetch and mount it for your tests. 3. CI/CD Configuration: - Ensure your GitHub Actions or other CI environment is set up to authenticate with GSM and run the secret-fetching step before running tests. - The
airbyte-ci
tool is responsible for this in Airbyte's official CI. If you are using a custom workflow, you may need to add a step to fetch secrets. 4. Secret File Path: - The secret will be mounted to
<connector-directory>/secrets/config.json
if the
fileName
is set to
config.json
in the metadata. Make sure this matches what your test expects. Summary: Your integration test is failing because the required secret file (
config.json
) is missing. Ensure that your secrets are correctly stored in GSM, your
metadata.yaml
is properly configured, and that your CI/CD pipeline or local environment fetches and mounts the secret before running tests. For more details, see the Airbyte documentation on [managing connector secrets in GSM](https://docs.airbyte.com/platform/1.7/connector-development/local-connector-development#managing-connector-secrets-in-gsm) and [connector metadata configuration](https://docs.airbyte.com/platform/1.7/connector-development/connector-metadata-file#the-connectortestsuitesoptions-section).