@profoundlogic/coderflow-cli 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commands/test.js +5 -3
- package/package.json +1 -1
package/lib/commands/test.js
CHANGED
|
@@ -288,8 +288,10 @@ export async function runTest(args = []) {
|
|
|
288
288
|
const serverUrl = await getServerUrl();
|
|
289
289
|
const apiKey = await getApiKey();
|
|
290
290
|
|
|
291
|
-
// Use fetch to stream logs
|
|
292
|
-
|
|
291
|
+
// Use fetch to stream logs. Include environment so the server can
|
|
292
|
+
// authorize the request under the tasks:view permission for that env.
|
|
293
|
+
const envQuery = encodeURIComponent(resolvedEnvironment);
|
|
294
|
+
const logsUrl = `${serverUrl}/test/${data.containerId}/logs?environment=${envQuery}`;
|
|
293
295
|
const headers = {
|
|
294
296
|
'Authorization': `Bearer ${apiKey}`,
|
|
295
297
|
'x-no-compression': '1'
|
|
@@ -317,7 +319,7 @@ export async function runTest(args = []) {
|
|
|
317
319
|
console.log('='.repeat(60));
|
|
318
320
|
|
|
319
321
|
// Check final status and exit with proper code
|
|
320
|
-
const statusCheck = await request(`/test/${data.containerId}/status`).catch(() => null);
|
|
322
|
+
const statusCheck = await request(`/test/${data.containerId}/status?environment=${envQuery}`).catch(() => null);
|
|
321
323
|
|
|
322
324
|
if (statusCheck) {
|
|
323
325
|
const exitCode = statusCheck.exitCode || 0;
|