Skip to content

Commit

Permalink
chore(storybook): rename env vars so we do not cause Nx Cloud connect…
Browse files Browse the repository at this point in the history
…ion errors (#27680)

The test to ensure we don't bundle secrets/tokens is causing an error
like this:

```
 NX   Connection to Nx Cloud failed with status code ERR_BAD_REQUEST
```

e.g. https://staging.nx.app/runs/0IjxPh53dK

Likely due to validation errors now in place. We shouldn't be hitting Nx
Cloud from the test project, so I've renamed the variables to be
something that isn't used to connect to Cloud.


<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
jaysoo authored Aug 28, 2024
1 parent 97fa7f1 commit be37c35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions e2e/storybook/src/storybook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ describe('Storybook generators and executors for monorepos', () => {
);
runCLI(`run ${reactStorybookApp}:build-storybook --verbose`, {
env: {
NX_CLOUD_ENCRYPTION_KEY: 'MY SECRET',
NX_CLOUD_ACCESS_TOKEN: 'MY SECRET',
NX_SOME_SECRET: 'MY SECRET',
NX_SOME_TOKEN: 'MY SECRET',
},
});

Expand All @@ -131,8 +131,8 @@ describe('Storybook generators and executors for monorepos', () => {
for (const file of files) {
if (!file.endsWith('.js')) continue;
const content = readFile(`${outDir}/${file}`);
expect(content).not.toMatch(/NX_CLOUD_ENCRYPTION_KEY/);
expect(content).not.toMatch(/NX_CLOUD_ACCESS_TOKEN/);
expect(content).not.toMatch(/NX_SOME_SECRET/);
expect(content).not.toMatch(/NX_SOME_TOKEN/);
expect(content).not.toMatch(/MY SECRET/);
}
}, 300_000);
Expand Down

0 comments on commit be37c35

Please sign in to comment.