Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: status log when NEXT_TELEMETRY_DISABLED env is set #43948

Merged
merged 4 commits into from Dec 12, 2022

Conversation

mattpr
Copy link
Contributor

@mattpr mattpr commented Dec 11, 2022

Fixes: #43947

Copy link
Member

@ijjk ijjk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, can you add a test case for this that fails without the change e.g. in https://github.com/vercel/next.js/blob/canary/test/integration/telemetry/test/index.test.js?

@mattpr mattpr requested a review from huozhi as a code owner December 12, 2022 18:43
@mattpr
Copy link
Contributor Author

mattpr commented Dec 12, 2022

Hi, can you add a test case for this that fails without the change e.g. in https://github.com/vercel/next.js/blob/canary/test/integration/telemetry/test/index.test.js?

Done.

FYI, it appears the the config changes (e.g. enabling and disabling telemetry) persist between tests so each test is testing relative to the current next config state rather than against the default/unconfigured next state.

So for instance checking for this output:
expect(stdout).toMatch(/Your preference has been saved/) is fine
but expect(stdout).toMatch(/Status: Disabled/) may not have anything to do with the command executed in the current test because next could already be in that state from some previous test and the currently tested command had no effect.

@ijjk ijjk changed the title Fix: NEXT_TELEMETRY_DISABLED was not respected. Fix: NEXT_TELEMETRY_DISABLED env handling Dec 12, 2022
Copy link
Member

@ijjk ijjk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Change and added test look good to ensure the env is honored properly.

@ijjk ijjk changed the title Fix: NEXT_TELEMETRY_DISABLED env handling Fix: status log when NEXT_TELEMETRY_DISABLED env is set Dec 12, 2022
@ijjk ijjk merged commit 3cb7adb into vercel:canary Dec 12, 2022
timneutkens pushed a commit that referenced this pull request Dec 13, 2022
Fixes: #43947

Co-authored-by: JJ Kasper <jj@jjsweb.site>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants