(client, dirName)
| 69 | } |
| 70 | |
| 71 | export async function pushActor(client, dirName) { |
| 72 | await copyPackages(dirName); |
| 73 | try { |
| 74 | // Capture all stdio (default would inherit stderr and flood the runner |
| 75 | // with the platform's Docker/npm build output on every test). The |
| 76 | // catch block below re-prints stdout/stderr if the push itself fails, |
| 77 | // so failure diagnostics stay intact. maxBuffer bumped because the |
| 78 | // build log can be tens of MB. |
| 79 | execSync('apify push', { |
| 80 | cwd: dirName, |
| 81 | env: { ...process.env, GIT_CEILING_DIRECTORIES: dirname(dirName) }, |
| 82 | stdio: 'pipe', |
| 83 | maxBuffer: 50 * 1024 * 1024, |
| 84 | }); |
| 85 | } catch (err) { |
| 86 | console.error(colors.red(`Failed to push actor to the Apify platform. (signal ${colors.yellow(err.signal)})`)); |
| 87 | |
| 88 | if (err.stdout) { |
| 89 | console.log(colors.grey(` STDOUT: `), err.stdout); |
| 90 | } |
| 91 | |
| 92 | if (err.stderr) { |
| 93 | console.log(colors.red(` STDERR: `), err.stderr); |
| 94 | } |
| 95 | |
| 96 | throw err; |
| 97 | } |
| 98 | |
| 99 | const actorName = await getActorName(dirName); |
| 100 | const { items: actors } = await client.actors().list(); |
| 101 | const { id } = actors.find((actor) => actor.name === actorName); |
| 102 | |
| 103 | return id; |
| 104 | } |
| 105 | |
| 106 | export async function startActorOnPlatform(client, id, input, inputContentType = 'application/json', memory = 4096) { |
| 107 | const gotClient = got.extend({ |
no test coverage detected
searching dependent graphs…