diff --git a/.changeset/loud-dots-bathe.md b/.changeset/loud-dots-bathe.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/loud-dots-bathe.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/health_checks.yml b/.github/workflows/health_checks.yml index fef7c581b8..d00ef3e514 100644 --- a/.github/workflows/health_checks.yml +++ b/.github/workflows/health_checks.yml @@ -19,6 +19,11 @@ on: - cron: '0 0,6,12,18 * * *' workflow_dispatch: +env: + # Health checks can run on un-released code. Often work in progress. + # Disable data from there. + AMPLIFY_DISABLE_TELEMETRY: true + jobs: install: strategy: diff --git a/packages/platform-core/src/usage-data/usage_data_emitter_factory.test.ts b/packages/platform-core/src/usage-data/usage_data_emitter_factory.test.ts index a447ad3604..7d7e0aaf84 100644 --- a/packages/platform-core/src/usage-data/usage_data_emitter_factory.test.ts +++ b/packages/platform-core/src/usage-data/usage_data_emitter_factory.test.ts @@ -1,5 +1,5 @@ import assert from 'node:assert'; -import { beforeEach, describe, it, mock } from 'node:test'; +import { after, before, beforeEach, describe, it, mock } from 'node:test'; import { UsageDataEmitterFactory } from './usage_data_emitter_factory'; import { DefaultUsageDataEmitter } from './usage_data_emitter'; @@ -21,6 +21,19 @@ void describe('UsageDataEmitterFactory', () => { () => mockedConfigController ); + const originalAmplifyDisableTelemetry = + process.env['AMPLIFY_DISABLE_TELEMETRY']; + + before(() => { + // Unset AMPLIFY_DISABLE_TELEMETRY. We may be setting this variable in GitHub workflows. + delete process.env['AMPLIFY_DISABLE_TELEMETRY']; + }); + + after(() => { + // Restore original value after tests. + process.env['AMPLIFY_DISABLE_TELEMETRY'] = originalAmplifyDisableTelemetry; + }); + beforeEach(() => { configControllerGet.mock.resetCalls(); });