Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
250127b
Refactor root of yarn monorepo from code to the git root. And NX agen…
kasperpeulen Nov 18, 2025
ec6d354
Fix distribution config
kasperpeulen Nov 27, 2025
3b0a2d7
Fix pretty docs
kasperpeulen Nov 27, 2025
7733316
Fix check
kasperpeulen Nov 27, 2025
69fbe0c
Clean up last things
kasperpeulen Nov 27, 2025
fbc2af4
Make sure the settings.json is deleted before the onboarding test.
kasperpeulen Nov 27, 2025
ac61afb
Update scripts/run-registry.ts
kasperpeulen Nov 27, 2025
ec1bd5d
Fix lint
kasperpeulen Nov 28, 2025
81a8497
Merge remote-tracking branch 'origin/kasper/yarn-monorepo-refactor' i…
kasperpeulen Nov 28, 2025
69106f4
Fix
kasperpeulen Nov 28, 2025
f35970d
Fix
kasperpeulen Nov 28, 2025
d80cf75
Fix
kasperpeulen Nov 28, 2025
c31e808
Merge remote-tracking branch 'origin/next' into kasper/yarn-monorepo-…
kasperpeulen Nov 28, 2025
ae1ebf8
Fix
kasperpeulen Nov 28, 2025
f04dd28
Cleanup
kasperpeulen Nov 28, 2025
d58d659
Make ports backwards compatible for local dev
kasperpeulen Nov 28, 2025
4446340
Remove TODOs
kasperpeulen Nov 28, 2025
5dd20f9
Revert
kasperpeulen Nov 28, 2025
7c89c17
Fix
kasperpeulen Nov 28, 2025
6e6a31c
Fix
kasperpeulen Nov 28, 2025
02e22fa
Fix
kasperpeulen Nov 28, 2025
40cdf8b
Fix
kasperpeulen Nov 28, 2025
39a4409
Fix
kasperpeulen Nov 28, 2025
b4b8b24
Fix
kasperpeulen Nov 28, 2025
729408e
Only move sandboxes to cache when NX is used
kasperpeulen Nov 28, 2025
b9a60d1
Fix build
kasperpeulen Nov 28, 2025
c7244fa
Fix
kasperpeulen Nov 28, 2025
73841fd
Fix
kasperpeulen Nov 28, 2025
a4f5eda
Fix
kasperpeulen Nov 28, 2025
7aa225e
Fix
kasperpeulen Nov 28, 2025
c289d52
Fix
kasperpeulen Nov 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
175 changes: 89 additions & 86 deletions .circleci/config.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .circleci/src/jobs/bench-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
# if there is a base branch AND a PR number in parameters, benchmark packages against those
# this happens when run against a PR
- when:
Expand Down Expand Up @@ -56,6 +56,6 @@ steps:
working_directory: scripts
command: yarn bench-packages --upload
- store_artifacts:
path: bench/packages/results.json
path: storybook/bench/packages/results.json
- report-workflow-on-failure
- cancel-workflow-on-failure
5 changes: 3 additions & 2 deletions .circleci/src/jobs/bench-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Install sandbox dependencies
command: |
corepack enable
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- run:
name: Running Bench
command: yarn task --task bench --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench) --no-link --start-from=never --junit
Expand Down
34 changes: 18 additions & 16 deletions .circleci/src/jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ steps:
- restore_cache:
name: Restore Yarn cache
keys:
- build-yarn-2-cache-v5--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
- build-yarn-2-cache-v5--{{ checksum "yarn.lock" }}
- run:
name: Compile
command: |
yarn
yarn task --task compile --start-from=auto --no-link --debug
git diff --exit-code
yarn dedupe --check
Expand All @@ -22,24 +23,25 @@ steps:
yarn local-registry --publish
- report-workflow-on-failure
- store_artifacts:
path: code/bench/esbuild-metafiles
path: storybook/code/bench/esbuild-metafiles
- save_cache:
name: Save Yarn cache
key: build-yarn-2-cache-v5--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
key: build-yarn-2-cache-v5--{{ checksum "yarn.lock" }}
paths:
- ~/.yarn/berry/cache
- persist_to_workspace:
root: .
root: /tmp
paths:
- code/node_modules
- code/addons
- scripts/node_modules
- code/bench
- code/examples
- code/frameworks
- code/lib
- code/core
- code/builders
- code/renderers
- code/presets
- .verdaccio-cache
- storybook/node_modules
- storybook/code/node_modules
- storybook/code/addons
- storybook/scripts/node_modules
- storybook/code/bench
- storybook/code/examples
- storybook/code/frameworks
- storybook/code/lib
- storybook/code/core
- storybook/code/builders
- storybook/code/renderers
- storybook/code/presets
- storybook/.verdaccio-cache
7 changes: 4 additions & 3 deletions .circleci/src/jobs/check-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Install sandbox dependencies
command: |
corepack enable
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task check-sandbox)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- run:
name: Type check Sandboxes
command: yarn task --task check-sandbox --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task check-sandbox) --no-link --start-from=never --junit
- report-workflow-on-failure:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task check-sandbox)
- store_test_results:
path: test-results
path: storybook/test-results
3 changes: 2 additions & 1 deletion .circleci/src/jobs/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ steps:
- restore_cache:
name: Restore Yarn cache
keys:
- build-yarn-2-cache-v5--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
- build-yarn-2-cache-v5--{{ checksum "yarn.lock" }}
- run:
name: Compile
command: |
yarn
yarn task --task compile --start-from=auto --no-link --debug
- run:
name: Check
Expand Down
4 changes: 2 additions & 2 deletions .circleci/src/jobs/chromatic-internal-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ steps:
# switched this to the CircleCI helper to get the full git history for TurboSnap
- checkout
- attach_workspace:
at: .
at: /tmp
- run:
name: Running Chromatic
command: yarn storybook:ui:chromatic
working_directory: code
- report-workflow-on-failure
- store_test_results:
path: test-results
path: storybook/test-results
11 changes: 7 additions & 4 deletions .circleci/src/jobs/chromatic-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ parallelism: << parameters.parallelism >>
steps:
- checkout
- attach_workspace:
at: .
at: /tmp
- run:
name: Install sandbox dependencies
# chromatic can only run in a git directory
command: |
corepack enable
cp /tmp/storybook-sandboxes /tmp/storybook/sandbox -r --remove-destination
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(STORYBOOK_SANDBOX_ROOT=./sandbox yarn get-sandbox-dir --template $TEMPLATE) && yarn
Comment on lines +19 to +22
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

cp options are in the wrong place and will break sandbox copying

The cp invocation is currently:

cp /tmp/storybook-sandboxes /tmp/storybook/sandbox -r --remove-destination

On GNU cp, options must come before the first non‑option argument; as written, -r/--remove-destination are treated as paths, so this command will fail and the sandbox won’t be copied.

Recommend:

-        cp /tmp/storybook-sandboxes /tmp/storybook/sandbox -r --remove-destination
+        cp -r --remove-destination /tmp/storybook-sandboxes /tmp/storybook/sandbox
🤖 Prompt for AI Agents
In .circleci/src/jobs/chromatic-sandboxes.yml around lines 19 to 22, the cp
command passes options after the source/destination so GNU cp treats them as
paths and fails; reorder the invocation so options precede non-option arguments
(e.g., place -r and --remove-destination immediately after cp) to ensure the
sandbox directory is copied correctly.

- run:
name: Running Chromatic
command: yarn task --task chromatic --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic) --no-link --start-from=never --junit
command: STORYBOOK_SANDBOX_ROOT=./sandbox yarn task --task chromatic --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic) --no-link --start-from=never --junit
- report-workflow-on-failure:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task chromatic)
- store_test_results:
path: test-results
path: storybook/test-results
2 changes: 1 addition & 1 deletion .circleci/src/jobs/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- codecov/upload
- report-workflow-on-failure
10 changes: 5 additions & 5 deletions .circleci/src/jobs/create-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Setup Corepack
command: |
Expand All @@ -31,15 +31,15 @@ steps:
if [[ $TEMPLATE != bench/* ]]; then
yarn --cwd scripts jiti ./event-log-checker.ts build $TEMPLATE
fi
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && rm -rf node_modules
cd $(yarn get-sandbox-dir --template $TEMPLATE) && rm -rf node_modules
environment:
STORYBOOK_TELEMETRY_DEBUG: 1
STORYBOOK_TELEMETRY_URL: 'http://localhost:6007/event-log'
- report-workflow-on-failure:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task sandbox)
- persist_to_workspace:
root: .
root: /tmp
paths:
- sandbox/**
storybook-sandboxes/**
- store_test_results:
path: test-results
path: storybook/test-results
9 changes: 5 additions & 4 deletions .circleci/src/jobs/e2e-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Install sandbox dependencies
command: |
corepack enable
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task e2e-tests-dev)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- run:
name: Running E2E Tests
# TEST_FILES should include all relevant test files, in this case we use the default playwright pattern
Expand All @@ -29,7 +30,7 @@ steps:
- report-workflow-on-failure:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task e2e-tests-dev)
- store_test_results:
path: test-results
path: storybook/test-results
- store_artifacts: # this is where playwright puts more complex stuff
path: code/playwright-results/
path: storybook/code/playwright-results/
destination: playwright
9 changes: 5 additions & 4 deletions .circleci/src/jobs/e2e-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Install sandbox dependencies
command: |
corepack enable
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task e2e-tests)
cd sandbox/$(yarn get-sandbox-dir --template $TEMPLATE) && yarn
cd $(yarn get-sandbox-dir --template $TEMPLATE) && yarn
- run:
name: Running E2E Tests
# TEST_FILES should include all relevant test files, in this case we use the default playwright pattern
Expand All @@ -29,7 +30,7 @@ steps:
- report-workflow-on-failure:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task e2e-tests)
- store_test_results:
path: test-results
path: storybook/test-results
- store_artifacts: # this is where playwright puts more complex stuff
path: code/playwright-results/
path: storybook/code/playwright-results/
destination: playwright
6 changes: 3 additions & 3 deletions .circleci/src/jobs/e2e-ui-vitest-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Install dependencies
command: yarn install --no-immutable
Expand All @@ -18,8 +18,8 @@ steps:
command: yarn playwright-e2e
working_directory: test-storybooks/portable-stories-kitchen-sink/react-vitest-3
- store_test_results:
path: test-results
path: storybook/test-results
- store_artifacts:
path: test-storybooks/portable-stories-kitchen-sink/react-vitest-3/test-results/
path: storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/test-results/
destination: playwright
Comment on lines 20 to 24
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read the full CircleCI config file to understand the working_directory and paths
cat -n ".circleci/src/jobs/e2e-ui-vitest-3.yml"

Repository: storybookjs/storybook

Length of output: 1046


🏁 Script executed:

#!/bin/bash
# Look for similar e2e CircleCI config files to understand the pattern
find .circleci/src/jobs -name "e2e-ui-vitest*.yml" -type f | sort

Repository: storybookjs/storybook

Length of output: 103


🏁 Script executed:

#!/bin/bash
# Check for all CircleCI job files and search for storybook/ references
find .circleci/src/jobs -name "*.yml" -type f | head -20

Repository: storybookjs/storybook

Length of output: 799


🏁 Script executed:

#!/bin/bash
# Check e2e-ui.yml for comparison
cat -n ".circleci/src/jobs/e2e-ui.yml"

Repository: storybookjs/storybook

Length of output: 1019


🏁 Script executed:

#!/bin/bash
# Check build.yml to understand the workspace structure
head -50 ".circleci/src/jobs/build.yml"

Repository: storybookjs/storybook

Length of output: 1378


🏁 Script executed:

#!/bin/bash
# Search for where test-storybooks directories are created
rg -n "test-storybooks" ".circleci/src/jobs/" -A 2 -B 2

Repository: storybookjs/storybook

Length of output: 5021


🏁 Script executed:

#!/bin/bash
# Look for main CircleCI config
find .circleci -name "config.yml" -o -name "config.yaml" | head -5

Repository: storybookjs/storybook

Length of output: 85


🏁 Script executed:

#!/bin/bash
# Search for e2e-ui-vitest-3 in the main config
rg -n "e2e-ui-vitest-3" ".circleci/config.yml" -A 5 -B 5

Repository: storybookjs/storybook

Length of output: 1609


🏁 Script executed:

#!/bin/bash
# Search for where test-storybooks is created or persisted
rg -n "persist_to_workspace" ".circleci/src/jobs/" -A 20 | grep -E "(persist_to_workspace|test-storybooks|portable-stories)" -A 3 -B 1

Repository: storybookjs/storybook

Length of output: 800


🏁 Script executed:

#!/bin/bash
# Search for test-storybooks directory in the repository
find . -maxdepth 2 -type d -name "test-storybooks" 2>/dev/null

Repository: storybookjs/storybook

Length of output: 82


🏁 Script executed:

#!/antml/bin/bash
# Check what git-shallow-clone does and understand the checkout flow
rg -n "git-shallow-clone" ".circleci/src/" -A 5 -B 2 | head -30

Repository: storybookjs/storybook

Length of output: 1783


🏁 Script executed:

#!/bin/bash
# Let's look for vitest config to see where test results are actually generated
find . -name "vitest.config.*" -type f | grep -i "test-storybooks\|portable-stories" | head -5

Repository: storybookjs/storybook

Length of output: 47


🏁 Script executed:

#!/bin/bash
# Search for vitest configs
find . -name "vitest.config.*" -type f

Repository: storybookjs/storybook

Length of output: 1922


🏁 Script executed:

#!/bin/bash
# Check the structure of test-storybooks
ls -la test-storybooks/ | head -20

Repository: storybookjs/storybook

Length of output: 571


🏁 Script executed:

#!/bin/bash
# Check portable-stories-kitchen-sink structure
ls -la test-storybooks/portable-stories-kitchen-sink/

Repository: storybookjs/storybook

Length of output: 453


🏁 Script executed:

#!/bin/bash
# Check react-vitest-3 structure and package.json
ls -la test-storybooks/portable-stories-kitchen-sink/react-vitest-3/

Repository: storybookjs/storybook

Length of output: 1174


Working directory paths must include storybook/ prefix to align with artifact storage paths.

The CircleCI configuration has a critical path mismatch:

  • Lines 13, 19 (working_directory): test-storybooks/portable-stories-kitchen-sink/react-vitest-3
  • Lines 21, 23 (store_test_results/store_artifacts): storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3/test-results/

The working directory paths are missing the storybook/ prefix. Since the workspace is attached at /tmp with all files under /tmp/storybook/, the working_directory should be:

working_directory: storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3

This same issue exists in .circleci/src/jobs/e2e-ui.yml (lines 13, 19). Update both files to include the storybook/ prefix in working_directory paths so test results are generated in the correct location for artifact storage.

🤖 Prompt for AI Agents
In .circleci/src/jobs/e2e-ui-vitest-3.yml around lines 20-24 (and also update
.circleci/src/jobs/e2e-ui.yml around lines 13 and 19), the working_directory is
missing the required storybook/ prefix so test output is written to the wrong
path; change the working_directory values to prepend "storybook/" (e.g.,
working_directory:
storybook/test-storybooks/portable-stories-kitchen-sink/react-vitest-3) so that
the job writes test results under the same storybook/test-results/artifacts
paths used by store_test_results and store_artifacts.

- report-workflow-on-failure
6 changes: 3 additions & 3 deletions .circleci/src/jobs/e2e-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Install dependencies
command: yarn install --no-immutable
Expand All @@ -18,8 +18,8 @@ steps:
command: yarn playwright-e2e
working_directory: test-storybooks/portable-stories-kitchen-sink/react
- store_test_results:
path: test-results
path: storybook/test-results
- store_artifacts:
path: test-storybooks/portable-stories-kitchen-sink/react/test-results/
path: storybook/test-storybooks/portable-stories-kitchen-sink/react/test-results/
destination: playwright
- report-workflow-on-failure
2 changes: 1 addition & 1 deletion .circleci/src/jobs/knip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Knip
command: |
Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/jobs/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Lint
command: |
Expand Down
7 changes: 3 additions & 4 deletions .circleci/src/jobs/pretty-docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
executor:
class: medium
class: medium+
name: sb_node_22_classic

steps:
Expand All @@ -8,15 +8,14 @@ steps:
- restore_cache:
name: Restore Yarn cache
keys:
- prettydocs-yarn-2-cache-v8--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
- prettydocs-yarn-2-cache-v8--{{ checksum "yarn.lock" }}
- run:
name: Install
command: |
cd scripts
yarn install
- save_cache:
name: Save Yarn cache
key: prettydocs-yarn-2-cache-v8--{{ checksum "code/yarn.lock" }}--{{ checksum "scripts/yarn.lock" }}
key: prettydocs-yarn-2-cache-v8--{{ checksum "yarn.lock" }}
paths:
- ~/.yarn/berry/cache
- run:
Expand Down
4 changes: 2 additions & 2 deletions .circleci/src/jobs/script-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Check parallelism count
command: |
Expand All @@ -21,6 +21,6 @@ steps:
cd scripts
yarn test --coverage
- store_test_results:
path: scripts/junit.xml
path: storybook/scripts/junit.xml
- report-workflow-on-failure
- cancel-workflow-on-failure
4 changes: 2 additions & 2 deletions .circleci/src/jobs/smoke-test-sandboxes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
at: /tmp
- run:
name: Smoke Testing Sandboxes
command: yarn task --task smoke-test --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task smoke-test) --no-link --start-from=never --junit
- report-workflow-on-failure:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task smoke-test)
- store_test_results:
path: test-results
path: storybook/test-results
4 changes: 2 additions & 2 deletions .circleci/src/jobs/stories-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ steps:
- git-shallow-clone/checkout_advanced:
clone_options: --depth 1 --verbose
- attach_workspace:
at: .
at: /tmp
- run:
command: |
cd code
TEST_FILES=$(circleci tests glob "**/*.{stories}.{ts,tsx,js,jsx,cjs}" | sed "/^e2e-tests\//d" | sed "/^node_modules\//d")
echo "$TEST_FILES" | circleci tests run --command="xargs yarn test --reporter=junit --reporter=default --outputFile=../test-results/junit-${CIRCLE_NODE_INDEX}.xml" --verbose
name: Run tests
- store_test_results:
path: test-results
path: storybook/test-results
Comment on lines 10 to +17
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🚨 Critical: Test results path mismatch between output and store location.

Line 14 outputs test results to ../test-results/junit-${CIRCLE_NODE_INDEX}.xml (relative to working directory code), but line 17 expects them at storybook/test-results.

With the workspace attached at /tmp, the relative path ../test-results resolves to /tmp/../test-results (outside the workspace), while CircleCI will look for results in /tmp/storybook/test-results.

Update the test output path to match the new store location:

-        echo "$TEST_FILES" | circleci tests run --command="xargs yarn test --reporter=junit --reporter=default --outputFile=../test-results/junit-${CIRCLE_NODE_INDEX}.xml" --verbose
+        echo "$TEST_FILES" | circleci tests run --command="xargs yarn test --reporter=junit --reporter=default --outputFile=../storybook/test-results/junit-${CIRCLE_NODE_INDEX}.xml" --verbose

Or, if the output directory structure should be different, update the store_test_results path to match.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- run:
command: |
cd code
TEST_FILES=$(circleci tests glob "**/*.{stories}.{ts,tsx,js,jsx,cjs}" | sed "/^e2e-tests\//d" | sed "/^node_modules\//d")
echo "$TEST_FILES" | circleci tests run --command="xargs yarn test --reporter=junit --reporter=default --outputFile=../test-results/junit-${CIRCLE_NODE_INDEX}.xml" --verbose
name: Run tests
- store_test_results:
path: test-results
path: storybook/test-results
- run:
command: |
cd code
TEST_FILES=$(circleci tests glob "**/*.{stories}.{ts,tsx,js,jsx,cjs}" | sed "/^e2e-tests\//d" | sed "/^node_modules\//d")
echo "$TEST_FILES" | circleci tests run --command="xargs yarn test --reporter=junit --reporter=default --outputFile=../storybook/test-results/junit-${CIRCLE_NODE_INDEX}.xml" --verbose
name: Run tests
- store_test_results:
path: storybook/test-results
🤖 Prompt for AI Agents
In .circleci/src/jobs/stories-tests.yml around lines 10 to 17, the CircleCI job
writes test output to ../test-results/junit-${CIRCLE_NODE_INDEX}.xml from inside
the code directory but configures store_test_results to look in
storybook/test-results, causing a path mismatch; fix by making the test command
write into the store_test_results directory (e.g., output to
storybook/test-results/junit-${CIRCLE_NODE_INDEX}.xml relative to the workspace)
or alternatively change store_test_results.path to ../test-results to match the
current output—ensure both paths match and are inside the workspace so CircleCI
can find and store the junit files.

- report-workflow-on-failure
- cancel-workflow-on-failure
Loading
Loading