ory / kratos

The most scalable and customizable identity server on the market. Replace your Homegrown, Auth0, Okta, Firebase with better UX and DX. Has all the tablestakes: Passkeys, Social Sign In, Multi-Factor Auth, SMS, SAML, TOTP, and more. Written in Go, cloud native, headless, API-first. Available as a service on Ory Network and for self-hosters.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=kratos
Apache License 2.0
11.24k stars 963 forks source link

Tests fail because `wait-on` cannot be found #2385

Closed zvictor closed 2 years ago

zvictor commented 2 years ago

Preflight checklist

Describe the bug

I have been trying to run Krato's e2e tests locally, using docker, but it fails at the wait-on command: https://github.com/ory/kratos/blob/e50551330d976845c696bf68b6d9b61221da59d3/test/e2e/run.sh#L122

Reproducing the bug

Steps to reproduce the error:

  1. Run docker run -v /var/run/docker.sock:/var/run/docker.sock -ti golang
  2. Inside the container, run
    
    apt-get update
    apt-get install -y build-essential make git curl nodejs npm psmisc netcat
    curl -sSL https://get.docker.com/ | sh

git clone https://github.com/ory/kratos.git /tmp/kratos cd /tmp/kratos/test/e2e ./run.sh sqlite


### Relevant log output

```shell
+ WEB_PORT=4457
+ KRATOS_URL=http://localhost:4433
+ npm run web -- --non-interactive
+ cd test/e2e
+ npm run wait-on -- -l -t 300000 http-get://127.0.0.1:4445/health/alive
+ DSN=memory
+ URLS_SELF_ISSUER=http://localhost:4444
+ LOG_LEVEL=trace
+ URLS_LOGIN=http://localhost:4446/login
+ URLS_CONSENT=http://localhost:4446/consent
+ hydra serve all --dangerous-force-http

> @ory/kratos-e2e-suite@0.0.1 wait-on
> wait-on "-l" "-t" "300000" "http-get://127.0.0.1:4445/health/alive"

sh: 1: wait-on: not found
npm ERR! code 127
npm ERR! path /tmp/kratos/test/e2e
npm ERR! command failed
npm ERR! command sh -c wait-on "-l" "-t" "300000" "http-get://127.0.0.1:4445/health/alive"

Relevant configuration

No response

Version

v0.8.2-alpha.1 and master

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Docker

Additional Context

No response

zvictor commented 2 years ago

Never mind! I had wrongly assumed that run.sh was installing all dependencies needed, given that it was running many npm i commands.

cd /tmp/kratos/test/e2e ; npm i is enough to fix this issue.

zvictor commented 2 years ago

I have stopped at the error below.

> @ory/integration-react@0.0.1 build
> next build

Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info  - Checking validity of types
warn  - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
info  - Using external babel configuration from /tmp/ci-PlK2i8Cn1M/ory/kratos-selfservice-ui-react-nextjs/.babelrc
info  - Creating an optimized production build
info  - Compiled successfully

> Build error occurred
/tmp/ci-PlK2i8Cn1M/ory/kratos-selfservice-ui-react-nextjs/node_modules/@ory/integrations/ui/index.js:11
    return node.meta.label?.text || "";
                           ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.8382 (/tmp/ci-PlK2i8Cn1M/ory/kratos-selfservice-ui-react-nextjs/.next/server/pages/index.js:25:18)
    at __webpack_require__ (/tmp/ci-PlK2i8Cn1M/ory/kratos-selfservice-ui-react-nextjs/.next/server/webpack-runtime.js:25:42)
    at Object.1122 (/tmp/ci-PlK2i8Cn1M/ory/kratos-selfservice-ui-react-nextjs/.next/server/chunks/122.js:1245:11) {
  type: 'SyntaxError'
}
info  - Collecting page data .npm ERR! code 1
npm ERR! path /tmp/ci-PlK2i8Cn1M/ory/kratos-selfservice-ui-react-nextjs
npm ERR! command failed
npm ERR! command sh -c next build

Isn't this being caught by anyone else?