@@ -65,33 +65,33 @@ func recordBrowserExtensionIntegrationTests(pipeline *bk.Pipeline) {
6565
6666func clientChromaticTests (opts CoreTestOperationsOptions ) operations.Operation {
6767 return func (pipeline * bk.Pipeline ) {
68- // stepOpts := []bk.StepOpt{
69- // withPnpmCache(),
70- // bk.AutomaticRetry(3),
71- // bk.Cmd("./dev/ci/pnpm-install-with-retry.sh"),
72- // bk.Cmd("pnpm run generate"),
73- // bk.Env("MINIFY", "1"),
74- // }
75- //
76- // // Upload storybook to Chromatic
77- // //
78- // // We run chromatic through `run-chromatic` because the script detects whether a build is being retried
79- // // and then adds the flag `--force-rebuild`. We need to do this because Chromatic fails when running on
80- // // the same commit.
81- // chromaticCommand := "./dev/ci/run-chromatic.sh --exit-zero-on-changes --exit-once-uploaded"
82- // if opts.ChromaticShouldAutoAccept {
83- // // have to specify a value. Value can either be a branch glob or a boolean
84- // // see https://www.chromatic.com/docs/cli/
85- // chromaticCommand += " --auto-accept-changes true"
86- // } else {
87- // // Unless we plan on automatically accepting these changes, we only run this
88- // // step on ready-for-review pull requests.
89- // stepOpts = append(stepOpts, bk.IfReadyForReview(opts.ForceReadyForReview))
90- // chromaticCommand += " | ./dev/ci/post-chromatic.sh"
91- // }
68+ stepOpts := []bk.StepOpt {
69+ withPnpmCache (),
70+ bk .AutomaticRetry (3 ),
71+ bk .Cmd ("./dev/ci/pnpm-install-with-retry.sh" ),
72+ bk .Cmd ("pnpm run generate" ),
73+ bk .Env ("MINIFY" , "1" ),
74+ }
75+
76+ // Upload storybook to Chromatic
9277 //
93- // pipeline.AddStep(":chromatic: Upload Storybook to Chromatic",
94- // append(stepOpts, bk.Cmd(chromaticCommand))...)
78+ // We run chromatic through `run-chromatic` because the script detects whether a build is being retried
79+ // and then adds the flag `--force-rebuild`. We need to do this because Chromatic fails when running on
80+ // the same commit.
81+ chromaticCommand := "./dev/ci/run-chromatic.sh --exit-zero-on-changes --exit-once-uploaded"
82+ if opts .ChromaticShouldAutoAccept {
83+ // have to specify a value. Value can either be a branch glob or a boolean
84+ // see https://www.chromatic.com/docs/cli/
85+ chromaticCommand += " --auto-accept-changes true"
86+ } else {
87+ // Unless we plan on automatically accepting these changes, we only run this
88+ // step on ready-for-review pull requests.
89+ stepOpts = append (stepOpts , bk .IfReadyForReview (opts .ForceReadyForReview ))
90+ chromaticCommand += " | ./dev/ci/post-chromatic.sh"
91+ }
92+
93+ pipeline .AddStep (":chromatic: Upload Storybook to Chromatic" ,
94+ append (stepOpts , bk .Cmd (chromaticCommand ))... )
9595 }
9696}
9797
0 commit comments