crawlee icon indicating copy to clipboard operation
crawlee copied to clipboard

fix(test): fix PLATFORM e2e tests

Open szmarczak opened this issue 3 years ago • 2 comments

https://github.com/apify/crawlee/actions/runs/3099905316/jobs/5019593606

szmarczak avatar Sep 21 '22 17:09 szmarczak

2022-09-21T17:44:18.892Z npm ERR! code
2022-09-21T17:44:18.893Z  ELSPROBLEMS
2022-09-21T17:44:18.895Z 
2022-09-21T17:44:18.897Z npm ERR! invalid: [email protected]+d4144b6 /usr/src/app/node_modules/apify
2022-09-21T17:44:18.899Z npm ERR!
2022-09-21T17:44:18.901Z  invalid: @crawlee/core@ /usr/src/app/node_modules/apify/node_modules/@crawlee/core
2022-09-21T17:44:18.903Z npm ERR!
2022-09-21T17:44:18.905Z  invalid: @crawlee/utils@ /usr/src/app/node_modules/apify/node_modules/@crawlee/utils
2022-09-21T17:44:18.907Z 
2022-09-21T17:44:18.909Z 
2022-09-21T17:44:18.911Z 
2022-09-21T17:44:18.913Z npm 
2022-09-21T17:44:18.915Z ERR!
2022-09-21T17:44:18.916Z  A complete log of this run can be found in:
2022-09-21T17:44:18.918Z npm ERR!
2022-09-21T17:44:18.920Z      /root/.npm/_logs/2022-09-21T17_44_17_760Z-debug-0.log
 node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^
Error [ApifyApiError]: Build with tag "latest" was not found. Was the actor built already?
  clientMethod: ActorClient.start
  statusCode: 403
  type: unknown-build-tag
  attempt: 1
  httpMethod: post
  path: /v2/acts/iP66YVPZ6ce9U0MDj/runs
  stack: 
    at makeRequest (/home/runner/work/crawlee/crawlee/node_modules/apify-client/dist/http_client.js:184:30)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ActorClient.start (/home/runner/work/crawlee/crawlee/node_modules/apify-client/dist/resource_clients/actor.js:84:26)
    at async ActorClient.call (/home/runner/work/crawlee/crawlee/node_modules/apify-client/dist/resource_clients/actor.js:104:24)
    at async runActor (file:///home/runner/work/crawlee/crawlee/test/e2e/tools.mjs:81:13)
    at async file:///home/runner/work/crawlee/crawlee/test/e2e/input-json5/test.mjs:6:26 {
  clientMethod: 'ActorClient.start',
  statusCode: 403,
  type: 'unknown-build-tag',
  attempt: 1,
  httpMethod: 'post',
  path: '/v2/acts/iP66YVPZ6ce9U0MDj/runs',
  originalStack: '\n' +
    '    at makeRequest (/home/runner/work/crawlee/crawlee/node_modules/apify-client/dist/http_client.js:184:30)\n' +
    '    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
    '    at async ActorClient.start (/home/runner/work/crawlee/crawlee/node_modules/apify-client/dist/resource_clients/actor.js:84:26)\n' +
    '    at async ActorClient.call (/home/runner/work/crawlee/crawlee/node_modules/apify-client/dist/resource_clients/actor.js:104:24)\n' +
    '    at async runActor (file:///home/runner/work/crawlee/crawlee/test/e2e/tools.mjs:81:13)\n' +
    '    at async file:///home/runner/work/crawlee/crawlee/test/e2e/input-json5/test.mjs:6:26'
}

but that's an Apify issue, the E2E PLATFORM tests are finally running.

szmarczak avatar Sep 21 '22 18:09 szmarczak

but that's an Apify issue

we need to resolve that too, the tests are not passing, that is the goal

FYI the failing test is the one you added, for JSON5, you can see the actor id in the error log

https://console.apify.com/admin/users/jTJJfizY5GgQwidZx/actors/iP66YVPZ6ce9U0MDj

2022-09-21T18:18:03.266Z ACTOR: Building Docker image.
2022-09-21T18:18:03.349Z Step 1/6 : FROM apify/actor-node:16-beta
2022-09-21T18:18:03.488Z  ---> 1f000d1c5b34
2022-09-21T18:18:03.492Z Step 2/6 : COPY packages ./packages
2022-09-21T18:18:03.494Z ACTOR: ERROR: Docker image build failed: COPY failed: file not found in build context or excluded by .dockerignore: stat packages: file does not exist

B4nan avatar Sep 21 '22 18:09 B4nan

Indeed you're right. The build failed:

2022-09-22T01:34:22.031Z ACTOR: Building Docker image.
2022-09-22T01:34:22.076Z Step 1/6 : FROM apify/actor-node:16-beta
2022-09-22T01:34:22.203Z  ---> 1f000d1c5b34
2022-09-22T01:34:22.205Z Step 2/6 : COPY packages ./packages
2022-09-22T01:34:22.208Z ACTOR: ERROR: Docker image build failed: COPY failed: file not found in build context or excluded by .dockerignore: stat packages: file does not exist

szmarczak avatar Sep 22 '22 02:09 szmarczak

Encountered https://github.com/apify/apify-sdk-js/issues/75

https://console.apify.com/view/runs/VlFcwNcE5IAsTKSrs

2022-09-22T03:01:56.448Z ACTOR: Pulling Docker image from repository.
2022-09-22T03:02:01.984Z ACTOR: Creating Docker container.
2022-09-22T03:02:02.085Z ACTOR: Starting Docker container.
2022-09-22T03:02:03.553Z node:internal/modules/cjs/loader:956
2022-09-22T03:02:03.555Z   const err = new Error(message);
2022-09-22T03:02:03.557Z               ^
2022-09-22T03:02:03.560Z 
2022-09-22T03:02:03.562Z Error: Cannot find module '@apify/timeout'
2022-09-22T03:02:03.564Z Require stack:
2022-09-22T03:02:03.566Z - /usr/src/app/node_modules/apify/dist/actor.js
2022-09-22T03:02:03.568Z     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
2022-09-22T03:02:03.570Z     at Function.Module._load (node:internal/modules/cjs/loader:804:27)
2022-09-22T03:02:03.572Z     at Module.require (node:internal/modules/cjs/loader:1028:19)
2022-09-22T03:02:03.575Z     at require (node:internal/modules/cjs/helpers:102:18)
2022-09-22T03:02:03.577Z     at Object.<anonymous> (/usr/src/app/node_modules/apify/dist/actor.js:7:19)
2022-09-22T03:02:03.579Z     at Module._compile (node:internal/modules/cjs/loader:1126:14)
2022-09-22T03:02:03.581Z     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
2022-09-22T03:02:03.583Z     at Module.load (node:internal/modules/cjs/loader:1004:32)
2022-09-22T03:02:03.586Z     at Function.Module._load (node:internal/modules/cjs/loader:839:12)
2022-09-22T03:02:03.587Z     at Module.require (node:internal/modules/cjs/loader:1028:19) {
2022-09-22T03:02:03.590Z   code: 'MODULE_NOT_FOUND',
2022-09-22T03:02:03.592Z   requireStack: [ '/usr/src/app/node_modules/apify/dist/actor.js' ]
2022-09-22T03:02:03.594Z }

szmarczak avatar Sep 22 '22 03:09 szmarczak

Blocked on https://github.com/apify/apify-sdk-js/pull/76

szmarczak avatar Sep 22 '22 04:09 szmarczak

Looks like its failing even more than before with those changes (after the linked apify sdk PR got merged, but maybe the version wasnt published yet on NPM, and I believe we need to bump it in the lock file so it can have effect on other than platform tests.

https://github.com/apify/crawlee/actions/runs/3103943417/jobs/5027841328

B4nan avatar Sep 22 '22 09:09 B4nan

@B4nan The JSON5 test is expected to fail on LOCAL since the repo doesn't contain JSON5 support. Only MEMORY and PLATFORM should work for now. I need to open a PR for LOCAL yet.

szmarczak avatar Sep 23 '22 01:09 szmarczak

Blocked on https://github.com/apify/apify-client-js/pull/278

szmarczak avatar Sep 26 '22 06:09 szmarczak