codeant-ai-for-open-source[bot] commented on code in PR #43230:
URL: https://github.com/apache/superset/pull/43230#discussion_r3871254061


##########
superset-frontend/scripts/test-storybook-ci.js:
##########
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+const path = require('node:path');
+const { concurrently } = require('concurrently');
+
+const storybookPort = '6006';
+const { result } = concurrently(
+  [
+    {
+      name: 'SB',
+      command: `python3 -m http.server ${storybookPort} --directory 
storybook-static`,
+    },
+    {
+      name: 'TEST',
+      command: `while ! nc -z 127.0.01 ${storybookPort}; do sleep 1; done && 
npm run test-storybook -- --maxWorkers=2`,
+    },
+  ],
+  {
+    killOthersOn: ['failure', 'success'],
+    successCondition: 'first',
+    prefixColors: ['magenta', 'blue'],
+    cwd: path.resolve(__dirname, '..'),
+  },
+);
+
+// Pass placeholder success/error handlers as CI runners should
+// show errors clearly
+result.then(
+  () => {},
+  () => {},
+);

Review Comment:
   Yes. The rejection is currently swallowed, so the Node process may exit with 
status `0` even when `concurrently` reports a failure. Set `process.exitCode` 
to a nonzero value in the rejection handler:
   
   ```js
   result.then(
     () => {},
     error => {
       console.error(error);
       process.exitCode = 1;
     },
   );
   ```
   
   This preserves the failure details in CI and ensures the Storybook job fails 
when either the server or tests fail.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to