question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Re-run of passing / accepted build failed through Chromatic Github action

See original GitHub issue

We are running Chromatic as part of a multi-step github workflow, which due to a slightly flaky test occasionally fails at a later step in the process. If this happens, we simply re-run the github action, which re-runs the chromatic action as part of that. If the chromatic build has already been accepted, it fails with the following error:

Run chromaui/action@v1
  with:
    token: ***
    projectToken: ***
    workingDir: modules/frontend
    exitOnceUploaded: true
    preserveMissing: true
  env:
    MONGOMS_SYSTEM_BINARY: /usr/bin/mongod
    PUPPETEER_DOWNLOAD_PATH: /home/ec2-user/.local-chromium

Chromatic CLI v6.3.3
https://www.chromatic.com/docs/cli

Authenticating with Chromatic
    → Connecting to https://index.chromatic.com
Authenticated with Chromatic
    → Using project token '********c0bf'
Retrieving git information
Could not retrieve package info from registry; skipping update check
Skipping build
    → Skipping rebuild of an already fully passed/accepted build



Error: Cannot read property 'toString' of undefined
Error: TypeError: Cannot read property 'toString' of undefined
    at /home/ec2-user/actions-runner/_work/_actions/chromaui/action/v1/action/main.js:350:1612938
    at /home/ec2-user/actions-runner/_work/_actions/chromaui/action/v1/action/main.js:350:1608861
    at Object.next (/home/ec2-user/actions-runner/_work/_actions/chromaui/action/v1/action/main.js:350:1608966)
    at o (/home/ec2-user/actions-runner/_work/_actions/chromaui/action/v1/action/main.js:350:1607680)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
Error: Cannot read property 'toString' of undefined

This is being thrown at https://github.com/chromaui/chromatic-cli/blob/524e18aca82d58d6fc6f60151783d2ef9a9215a7/action-src/main.ts#L192

I believe this is due to the exit code not being set before the return on https://github.com/chromaui/chromatic-cli/blob/524e18aca82d58d6fc6f60151783d2ef9a9215a7/bin-src/tasks/gitInfo.js#L91

so I have opened #492 which, if I have worked out the cause correctly, will fix it. I don’t know how run the actions script locally and I couldn’t spot any tests you had which verified the exit code, so I have made no changes there.

Side note - why does this check (not re-running on the same commit) only skip if the build is passed or accepted? If the commit is identical, should the build not be identical and therefore always skipped?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
ghengeveldcommented, Jan 10, 2022

Fixed in 6.3.4.

2reactions
Tri4Tycommented, Jan 4, 2022

+1 … we are seeing similar problems and are blocked by this ‘toString’ undefined issues as well … searching for solutions, hoping @RobertStanyon’s PR resolves this (anxiously awaiting the merge). Please update if anyone resolves this another way or has ideas

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automate Chromatic with GitHub Actions • Chromatic docs
Re-run failed builds after verifying UI test results​​ Once you accept all the changes, re-run the workflow, and the chromatic-deployment job will pass....
Read more >
Github pull request - Waiting for status to be reported
I found a workaround! You need to create a new PR for the same commit using different branch name. This ...
Read more >
Storybook Office Hours: Everything Chromatic - YouTube
Hey everyone! This is the last edition of the Storybook office hours and we have another exciting guest! This time, Varun Vachhar from...
Read more >
Test runner Addon | Storybook: Frontend workshop for UI ...
1. Running against deployed Storybooks on Github Actions deployment; 2. Running against locally built Storybooks in CI. Setting up code coverage.
Read more >
How to Fix Flaky Tests - Semaphore CI
You may be thinking that if a test fails randomly, you can game the system by retrying it until it passes. If this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found