Déploiment sur GitLab

Hello,

Je suis en train d’essayer de faire une intégration CI via GitLab et j’ai des soucis de compilation !
Je me suis basé les sur le pipeline circle ci
Si vous avez des idées je suis preneur ! :slight_smile:
A priori ça vient de bcrypt, j’ai essayé de relancer la compile mais ça plante tout de même.

J’ai un problème sur la tâche test_server et build_server

Les taches en question :

test_server:
  image: node:12
  stage: test
  script:
      # Install system dependencies 
    - apt-get update && apt-get install -y libudev-dev sqlite3 openssl openzwave libopenzwave1.5-dev build-essential python
      # Install global dependencies
    - npm install typescript node-gyp npm@latest -g
    - cd server
      # Install NPM dependencies
    - npm install
    - npm rebuild bcrypt --build-from-source
      # Run prettier
    - npm run prettier-check
      # Run eslint
    - npm run eslint
      # Run tests witch coverage
    - npm run coverage
.build_job_template: &build_job_definition
  image: docker:18.06.3-ce-git
  stage: deploy
  script:
      # Login in Gitlab Docker Registry
    - echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
      # Install build dependencies
    - apk update && apk add --no-cache bash curl git jq make perl
    - apk --no-cache add --virtual builds-deps build-base python
  #  - npm rebuild bcrypt --build-from-source
      # To add qemu and define IMAGE_ID
    - chmod +x .gitlab/load_env.sh
    - set -eu
    - . .gitlab/load_env.sh
      # Build the image
    - docker build -f docker/Dockerfile 
      -t ${IMAGE_ID} --build-arg target=$TARGET 
      --build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") 
      --build-arg VERSION=$VERSION 
      .
      # Push the image
    - docker push ${IMAGE_ID}

les erreurs dans les tests :

 npm install

> bcrypt@3.0.6 install /builds/*****/Gladys/server/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-linux-x64-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@12.13.1 (node-v72 ABI, glibc) (falling back to source compile with node-gyp) 
make: Entering directory '/builds/*****/Gladys/server/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /builds/*****/Gladys/server/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/builds/*****/Gladys/server/node_modules/bcrypt/build'

> node-webcrypto-ossl@1.0.48 install /builds/*****/Gladys/server/node_modules/node-webcrypto-ossl
> node-gyp rebuild

make: Entering directory '/builds/*****/Gladys/server/node_modules/node-webcrypto-ossl/build'
  CXX(target) Release/obj.target/nodessl/src/main.o
  CXX(target) Release/obj.target/nodessl/src/core/key_exp.o
  CXX(target) Release/obj.target/nodessl/src/core/scoped_ssl.o
  CXX(target) Release/obj.target/nodessl/src/core/logger.o
  CXX(target) Release/obj.target/nodessl/src/core/excep.o
  CXX(target) Release/obj.target/nodessl/src/core/digest.o
  CXX(target) Release/obj.target/nodessl/src/core/bn.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_gen.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_jwk.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_pkcs1.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_oaep.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_pss.o
  CXX(target) Release/obj.target/nodessl/src/ec/ec_gen.o
  CXX(target) Release/obj.target/nodessl/src/ec/ec_dsa.o
  CXX(target) Release/obj.target/nodessl/src/ec/ec_dh.o
  CXX(target) Release/obj.target/nodessl/src/ec/ec_jwk.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_gen.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_ecb.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_cbc.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_gcm.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_ctr.o
  CXX(target) Release/obj.target/nodessl/src/hmac/hmac_gen.o
  CXX(target) Release/obj.target/nodessl/src/hmac/hmac_sign.o
  CXX(target) Release/obj.target/nodessl/src/pbkdf2/pbkdf2_derive.o
  CXX(target) Release/obj.target/nodessl/src/node/common.o
  CXX(target) Release/obj.target/nodessl/src/node/w_key.o
  CXX(target) Release/obj.target/nodessl/src/node/w_aes.o
  CXX(target) Release/obj.target/nodessl/src/node/w_hmac.o
  CXX(target) Release/obj.target/nodessl/src/node/w_pbkdf2.o
  CXX(target) Release/obj.target/nodessl/src/node/w_core.o
  CXX(target) Release/obj.target/nodessl/src/node/async_rsa.o
  CXX(target) Release/obj.target/nodessl/src/node/async_ec.o
  CXX(target) Release/obj.target/nodessl/src/node/async_aes.o
  CXX(target) Release/obj.target/nodessl/src/node/async_hmac.o
  CXX(target) Release/obj.target/nodessl/src/node/async_pbkdf2.o
  CXX(target) Release/obj.target/nodessl/src/node/async_core.o
  SOLINK_MODULE(target) Release/obj.target/nodessl.node
  COPY Release/nodessl.node
make: Leaving directory '/builds/*****/Gladys/server/node_modules/node-webcrypto-ossl/build'

> sqlite3@4.1.0 install /builds/*****/Gladys/server/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[sqlite3] Success: "/builds/*****/Gladys/server/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node" is installed via remote

> core-js@2.6.10 postinstall /builds/*****/Gladys/server/node_modules/core-js
> node postinstall || echo "ignore"


> nodemon@1.19.4 postinstall /builds/*****/Gladys/server/node_modules/nodemon
> node bin/postinstall || exit 0

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

npm WARN lifecycle gladys-server@~postinstall: cannot run in wd gladys-server@ node ./cli/install_service_dependencies.js (wd=/builds/*****/Gladys/server)
npm WARN gladys-server@ No description
npm WARN gladys-server@ No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1188 packages from 1428 contributors and audited 5335 packages in 51.181s
found 13 vulnerabilities (1 moderate, 11 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
$ npm run prettier-check

> gladys-server@ prettier-check /builds/*****/Gladys/server
> prettier --check '**/*.js' '**/*.json'

Checking formatting...
All matched files use Prettier code style!
$ npm run eslint

> gladys-server@ eslint /builds/*****/Gladys/server
> eslint .


/builds/*****/Gladys/server/services/mqtt/index.js
  6:24  error  Unable to resolve path to module 'mqtt'  import/no-unresolved

/builds/*****/Gladys/server/services/philips-hue/index.js
  8:29  error  Unable to resolve path to module 'node-hue-api'  import/no-unresolved

/builds/*****/Gladys/server/services/philips-hue/lib/light/index.js
  1:28  error  Unable to resolve path to module 'bottleneck/es5'  import/no-unresolved

/builds/*****/Gladys/server/services/rtsp-camera/index.js
  6:26  error  Unable to resolve path to module 'fluent-ffmpeg'  import/no-unresolved

/builds/*****/Gladys/server/services/telegram/index.js
  10:31  error  Unable to resolve path to module 'node-telegram-bot-api'  import/no-unresolved

/builds/*****/Gladys/server/services/usb/api/usb.controller.js
  13:17  warning  Unexpected unnamed function  func-names

/builds/*****/Gladys/server/services/usb/index.js
  5:30  error  Unable to resolve path to module 'serialport'  import/no-unresolved

/builds/*****/Gladys/server/services/zwave/index.js
  7:25  error  Unable to resolve path to module 'openzwave-shared'  import/no-unresolved

/builds/*****/Gladys/server/test/benchmark/triggers.js
  68:8  warning  Unexpected constant condition  no-constant-condition

/builds/*****/Gladys/server/test/lib/gateway/GladysGatewayClientMock.test.js
  4:33  warning  Unexpected unnamed function  func-names

✖ 10 problems (7 errors, 3 warnings)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gladys-server@ eslint: `eslint .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gladys-server@ eslint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-12-05T14_54_43_396Z-debug.log

Le début des erreurs dans le build :

> bcrypt@3.0.6 install /src/server/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-linux-x64-musl.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@12.13.1 (node-v72 ABI, musl) (falling back to source compile with node-gyp) 
make: Entering directory '/src/server/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
In file included from ../src/bcrypt_node.cc:1:
../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker*)':
../../nan/nan.h:2232:62: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../../nan/nan.h:53,
                 from ../src/bcrypt_node.cc:1:
../src/bcrypt_node.cc: At global scope:
/root/.cache/node-gyp/12.13.1/include/node/node.h:566:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/root/.cache/node-gyp/12.13.1/include/node/node.h:600:3: note: in expansion of macro 'NODE_MODULE_X'
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/bcrypt_node.cc:378:1: note: in expansion of macro 'NODE_MODULE'
 NODE_MODULE(bcrypt_lib, init);
 ^~~~~~~~~~~
In file included from /root/.cache/node-gyp/12.13.1/include/node/node.h:63,
                 from ../../nan/nan.h:53,
                 from ../src/bcrypt_node.cc:1:
/root/.cache/node-gyp/12.13.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]':
/root/.cache/node-gyp/12.13.1/include/node/node_object_wrap.h:84:78:   required from here
/root/.cache/node-gyp/12.13.1/include/node/v8.h:10004:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo<node::ObjectWrap>::Callback' {aka 'void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo<void>&)'} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/.cache/node-gyp/12.13.1/include/node/v8.h: In instantiation of 'void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]':
../../nan/nan_object_wrap.h:65:61:   required from here
/root/.cache/node-gyp/12.13.1/include/node/v8.h:10004:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback' {aka 'void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo<void>&)'} [-Wcast-function-type]
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /src/server/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/src/server/node_modules/bcrypt/build'

> node-webcrypto-ossl@1.0.48 install /src/server/node_modules/node-webcrypto-ossl
> node-gyp rebuild

make: Entering directory '/src/server/node_modules/node-webcrypto-ossl/build'
  CXX(target) Release/obj.target/nodessl/src/main.o

Plus de log est dispo si besoin :sweat_smile:

D’après tes logs, je n’ai pas l’impression qu’il y ait des erreurs sur Bcrypt.
Il lance la compil et les messages indiquent seulement des warnings, il me semble (pas facile à lire dans les posts).

Je pense que les erreurs viennent plutôt du fait qu’il ne parvient pas à trouver les modules.
Essaie de faire comme dans la config de circleci, en mettant sur la même ligne :

cd server && npm install

J’ai essayé, mais ça ne change rien, GitLab fonctionne un peu différemment sur ce point, chaque instruction est exécutée à la suite sans reset le shell.
La tache de test :

test_server:
  image: node:12
  stage: test
  script:
      # Install system dependencies 
    - apt-get update && apt-get install -y libudev-dev sqlite3 openssl openzwave libopenzwave1.5-dev build-essential python
      # Install global dependencies
    - npm install typescript node-gyp npm@latest -g
      # Install NPM dependencies
    - cd server && npm install
    - ls -lA
    - ls  node_modules
      # Run prettier
    - npm run prettier-check
      # Run eslint
    - npm run eslint
      # Run tests witch coverage
    - npm run coverage
  coverage: /^Statements\s*:\s*([^%]+)/
  allow_failure: true

Le log “complet” :

$ npm install typescript node-gyp npm@latest -g
/usr/local/bin/node-gyp -> /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
/usr/local/bin/tsserver -> /usr/local/lib/node_modules/typescript/bin/tsserver
/usr/local/bin/tsc -> /usr/local/lib/node_modules/typescript/bin/tsc
+ node-gyp@6.0.1
+ npm@6.13.2
+ typescript@3.7.3
added 102 packages from 68 contributors and updated 8 packages in 312.307s
$ cd server && npm install

> bcrypt@3.0.6 install /builds/********/Gladys/server/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.6/bcrypt_lib-v3.0.6-node-v72-linux-x64-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.6 and node@12.13.1 (node-v72 ABI, glibc) (falling back to source compile with node-gyp) 
make: Entering directory '/builds/********/Gladys/server/node_modules/bcrypt/build'
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
  COPY Release/bcrypt_lib.node
  COPY /builds/********/Gladys/server/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory '/builds/********/Gladys/server/node_modules/bcrypt/build'

> node-webcrypto-ossl@1.0.48 install /builds/********/Gladys/server/node_modules/node-webcrypto-ossl
> node-gyp rebuild

make: Entering directory '/builds/********/Gladys/server/node_modules/node-webcrypto-ossl/build'
  CXX(target) Release/obj.target/nodessl/src/main.o
  CXX(target) Release/obj.target/nodessl/src/core/key_exp.o
  CXX(target) Release/obj.target/nodessl/src/core/scoped_ssl.o
  CXX(target) Release/obj.target/nodessl/src/core/logger.o
  CXX(target) Release/obj.target/nodessl/src/core/excep.o
  CXX(target) Release/obj.target/nodessl/src/core/digest.o
  CXX(target) Release/obj.target/nodessl/src/core/bn.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_gen.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_jwk.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_pkcs1.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_oaep.o
  CXX(target) Release/obj.target/nodessl/src/rsa/rsa_pss.o
  CXX(target) Release/obj.target/nodessl/src/ec/ec_gen.o
  CXX(target) Release/obj.target/nodessl/src/ec/ec_dsa.o
  CXX(target) Release/obj.target/nodessl/src/ec/ec_dh.o
  CXX(target) Release/obj.target/nodessl/src/ec/ec_jwk.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_gen.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_ecb.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_cbc.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_gcm.o
  CXX(target) Release/obj.target/nodessl/src/aes/aes_ctr.o
  CXX(target) Release/obj.target/nodessl/src/hmac/hmac_gen.o
  CXX(target) Release/obj.target/nodessl/src/hmac/hmac_sign.o
  CXX(target) Release/obj.target/nodessl/src/pbkdf2/pbkdf2_derive.o
  CXX(target) Release/obj.target/nodessl/src/node/common.o
  CXX(target) Release/obj.target/nodessl/src/node/w_key.o
  CXX(target) Release/obj.target/nodessl/src/node/w_aes.o
  CXX(target) Release/obj.target/nodessl/src/node/w_hmac.o
  CXX(target) Release/obj.target/nodessl/src/node/w_pbkdf2.o
  CXX(target) Release/obj.target/nodessl/src/node/w_core.o
  CXX(target) Release/obj.target/nodessl/src/node/async_rsa.o
  CXX(target) Release/obj.target/nodessl/src/node/async_ec.o
  CXX(target) Release/obj.target/nodessl/src/node/async_aes.o
  CXX(target) Release/obj.target/nodessl/src/node/async_hmac.o
  CXX(target) Release/obj.target/nodessl/src/node/async_pbkdf2.o
  CXX(target) Release/obj.target/nodessl/src/node/async_core.o
  SOLINK_MODULE(target) Release/obj.target/nodessl.node
  COPY Release/nodessl.node
make: Leaving directory '/builds/********/Gladys/server/node_modules/node-webcrypto-ossl/build'

> sqlite3@4.1.0 install /builds/********/Gladys/server/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[sqlite3] Success: "/builds/********/Gladys/server/node_modules/sqlite3/lib/binding/node-v72-linux-x64/node_sqlite3.node" is installed via remote

> core-js@2.6.10 postinstall /builds/********/Gladys/server/node_modules/core-js
> node postinstall || echo "ignore"


> nodemon@1.19.4 postinstall /builds/********/Gladys/server/node_modules/nodemon
> node bin/postinstall || exit 0

Love nodemon? You can now support the project via the open collective:
 > https://opencollective.com/nodemon/donate

npm WARN lifecycle gladys-server@~postinstall: cannot run in wd gladys-server@ node ./cli/install_service_dependencies.js (wd=/builds/********/Gladys/server)
npm WARN gladys-server@ No description
npm WARN gladys-server@ No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1188 packages from 1428 contributors and audited 5335 packages in 65.742s
found 13 vulnerabilities (1 moderate, 11 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
$ ls -lA
total 464
-rw-rw-rw-   1 root root     45 Dec  6 15:00 .eslintignore
-rw-rw-rw-   1 root root   3782 Dec  6 15:00 .eslintrc.json
-rw-rw-rw-   1 root root     45 Dec  6 15:00 .prettierignore
-rw-rw-rw-   1 root root    153 Dec  6 15:00 .prettierrc.json
drwxrwxrwx   5 root root   4096 Dec  6 15:00 api
-rw-rw-rw-   1 root root    177 Dec  6 15:00 apidoc.json
drwxrwxrwx   2 root root   4096 Dec  6 15:00 cli
drwxrwxrwx   4 root root   4096 Dec  6 15:00 config
-rw-rw-rw-   1 root root    594 Dec  6 15:00 index.js
-rw-rw-rw-   1 root root    164 Dec  6 15:00 jsconfig.json
drwxrwxrwx  23 root root   4096 Dec  6 15:00 lib
drwxrwxrwx   2 root root   4096 Dec  6 15:00 migrations
drwxrwxrwx   2 root root   4096 Dec  6 15:00 models
drwxr-xr-x 768 root root  24576 Dec  6 15:07 node_modules
-rw-rw-rw-   1 root root 369672 Dec  6 15:00 package-lock.json
-rw-rw-rw-   1 root root   3544 Dec  6 15:00 package.json
drwxrwxrwx   2 root root   4096 Dec  6 15:00 seeders
drwxrwxrwx  12 root root   4096 Dec  6 15:00 services
drwxrwxrwx   9 root root   4096 Dec  6 15:00 test
drwxrwxrwx   2 root root   4096 Dec  6 15:00 utils
$ ls  node_modules
@babel
@bluelovers
@ctrlpanel
@gladysassistant
@microsoft
@nodelib
@novel-segment
@sinonjs
@types
JSONStream
abbrev
accepts
acorn
acorn-jsx
adler-32
after
agent-base
ajv
ansi-align
ansi-escapes
ansi-regex
ansi-styles
anymatch
apidoc
apidoc-core
append-transform
aproba
archy
are-we-there-yet
argparse
argv
arr-diff
arr-flatten
arr-union
array-buffer-to-hex
array-find-index
array-flatten
array-from
array-hyper-unique
array-includes
array-unique
arraybuffer.slice
asn1
assert-plus
assertion-error
assign-symbols
astral-regex
async
async-each
async-limiter
asynckit
atob
auto-bind
aws-sign2
aws4
axios
babel-runtime
backo2
balanced-match
base
base64-arraybuffer
bcrypt
bcrypt-pbkdf
better-assert
big.js
bignumber.js
binary-extensions
bl
blob
bluebird
body-parser
boxen
brace-expansion
braces
browser-stdout
buffer-alloc
buffer-alloc-unsafe
buffer-equal-constant-time
buffer-fill
buffer-from
bytes
cache-base
caching-transform
callsite
callsites
camelcase
camelcase-keys
capture-stack-trace
caseless
catharsis
cfb
chai
chai-as-promised
chalk
chardet
check-error
chinese-parseint
chinese_convert
chokidar
chownr
ci-info
cjk-conv
class-proxy
class-utils
cli-boxes
cli-color
cli-cursor
cli-width
cliui
cls-bluebird
code-point-at
codecov
codepage
collection-visit
color
color-convert
color-name
color-string
colornames
colors
colorspace
combined-stream
commander
comment-parser
commondir
component-bind
component-emitter
component-inherit
compressible
compression
concat-map
concat-stream
config-chain
configstore
confusing-browser-globals
console-control-strings
contains-path
content-disposition
content-type
convert-source-map
cookie
cookie-signature
cookiejar
copy-descriptor
core-decorators
core-js
core-util-is
cp-file
crc-32
create-error-class
crlf-normalize
cross-env
cross-spawn
crypto-digest-sync
crypto-random-hex
crypto-random-string
csstype
currently-unhandled
d
dashdash
dateformat
debug
decamelize
decode-uri-component
deep-eql
deep-equal
deep-extend
deep-is
deepmerge
deepmerge-plus
default-require-extensions
define-properties
define-property
delayed-stream
delegates
depd
destroy
detect-libc
diagnostics
diff
docker-modem
dockerode
doctrine
dot-prop
dotenv
dottie
doublearray
duplexer3
ecc-jsbn
ecdsa-sig-formatter
editorconfig
ee-first
emoji-regex
enabled
encode-utf8
encodeurl
end-of-stream
engine.io-client
engine.io-parser
entities
env-variable
error-ex
es-abstract
es-to-primitive
es5-ext
es6-class-prototype
es6-error
es6-iterator
es6-object-assign
es6-promise
es6-promisify
es6-symbol
es6-weak-map
escape-html
escape-string-regexp
escodegen
eslint
eslint-config-airbnb
eslint-config-airbnb-base
eslint-config-prettier
eslint-import-resolver-node
eslint-module-utils
eslint-plugin-import
eslint-plugin-jsdoc
eslint-plugin-require-jsdoc
eslint-scope
eslint-utils
eslint-visitor-keys
espree
esprima
esquery
esrecurse
estraverse
esutils
etag
event-emitter
execa
exit-on-epipe
expand-brackets
express
express-rate-limit
extend
extend-shallow
external-editor
extglob
extsprintf
fast-deep-equal
fast-glob
fast-json-stable-stringify
fast-levenshtein
fast-safe-stringify
fastq
fecha
figures
file-entry-cache
fill-keys
fill-range
finalhandler
find-cache-dir
find-up
flat-cache
flatted
follow-redirects
for-in
foreground-child
forever-agent
form-data
formidable
forwarded
frac
fragment-cache
fresh
fs-constants
fs-extra
fs-minipass
fs.realpath
function-bind
functional-red-black-tree
gauge
generic-pool
get-caller-file
get-func-name
get-stdin
get-stream
get-value
getpass
glob
glob-parent
global-dirs
globals
got
graceful-fs
grapheme-splitter
growl
handlebars
har-schema
har-validator
has
has-binary2
has-cors
has-flag
has-symbols
has-unicode
has-value
has-values
hasha
he
hex-lib
hex-to-array-buffer
hoek
hosted-git-info
http-errors
http-signature
https-proxy-agent
iconv-lite
ignore
ignore-by-default
ignore-walk
import-fresh
import-lazy
imurmurhash
indent-string
indexof
inflection
inflight
inherits
ini
inquirer
interpret
ipaddr.js
is-accessor-descriptor
is-arguments
is-arrayish
is-binary-path
is-bluebird
is-buffer
is-callable
is-ci
is-data-descriptor
is-date-object
is-descriptor
is-extendable
is-extglob
is-finite
is-fullwidth-code-point
is-glob
is-installed-globally
is-mergeable-object
is-npm
is-number
is-obj
is-object
is-path-inside
is-plain-object
is-promise
is-redirect
is-regex
is-retry-allowed
is-stream
is-symbol
is-typedarray
is-utf8
is-windows
isarray
isemail
isexe
isobject
isstream
istanbul-lib-coverage
istanbul-lib-hook
istanbul-lib-instrument
istanbul-lib-report
istanbul-lib-source-maps
istanbul-reports
japanese
joi
js-beautify
js-tokens
js-yaml
js2xmlparser
jsbn
jsdoc
jsdoctypeparser
jsesc
json-parse-better-errors
json-schema
json-schema-traverse
json-stable-stringify-without-jsonify
json-stringify-safe
jsonfile
jsonparse
jsonwebtoken
jsprim
just-extend
jwa
jws
kind-of
klaw
klaw-sync
kuler
kuromoji
latest-version
levn
linkify-it
load-json-file
locate-path
lodash
lodash.clonedeep
lodash.escaperegexp
lodash.flattendeep
lodash.includes
lodash.isboolean
lodash.isequal
lodash.isinteger
lodash.isnumber
lodash.isplainobject
lodash.isstring
lodash.last
lodash.max
lodash.once
lodash.sortby
lodash.tonumber
lodash.trimend
logform
lolex
loud-rejection
lowercase-keys
lru-cache
lru-queue
make-dir
map-cache
map-obj
map-visit
markdown-it
markdown-it-anchor
marked
mdurl
media-typer
memoizee
memorystream
meow
merge-descriptors
merge-source-map
merge2
methods
micromatch
mime
mime-db
mime-types
mimic-fn
minimatch
minimist
minipass
minizlib
mixin-deep
mkdirp
mocha
mock-express-request
mock-req
module-not-found-error
moment
moment-timezone
ms
mute-stream
nan
nanomatch
natural-compare
needle
negotiator
neo-async
nested-error-stacks
next-tick
nice-try
nise
nock
node-fetch
node-nlp
node-pre-gyp
node-webcrypto-ossl
nodemon
nopt
normalize-package-data
normalize-path
novel-segment
npm-bundled
npm-packlist
npm-run-all
npm-run-path
npmlog
number-is-nan
nyc
oauth-sign
object-assign
object-component
object-copy
object-inspect
object-is
object-keys
object-visit
object.assign
object.entries
object.pick
object.values
on-finished
on-headers
once
one-time
onetime
optimist
optionator
os-homedir
os-tmpdir
osenv
p-finally
p-limit
p-locate
p-try
package-hash
package-json
pad-start
parent-module
parse-json
parseqs
parseuri
parseurl
pascalcase
path-dirname
path-exists
path-is-absolute
path-is-inside
path-key
path-parse
path-to-regexp
path-type
pathval
performance-now
picomatch
pidtree
pify
pinkie
pinkie-promise
pkg-dir
posix-character-classes
prelude-ls
prepend-http
prettier
printj
process-nextick-args
progress
propagate
proto-list
proxy-addr
proxyquire
pseudomap
psl
pstree.remy
pump
punycode
qs
queue
range-parser
raw-body
rc
read-pkg
read-pkg-up
readable-stream
readdirp
rechoir
redent
regenerator-runtime
regex-not
regexp-cjk
regexp-helper
regexp-helper-core
regexp-parser-event
regexp-parser-literal
regexp-range
regexp-support
regexp.prototype.flags
regexpp
regexpp2
registry-auth-token
registry-url
release-zalgo
remove-trailing-separator
repeat-element
repeat-string
repeating
request
require-directory
require-main-filename
requizzle
resolve
resolve-from
resolve-url
restore-cursor
ret
retry-as-promised
reusify
rimraf
run-async
run-parallel
runes2
rxjs
safe-buffer
safe-regex
safer-buffer
sax
secure-remote-password
segment-dict
semver
semver-diff
send
sequelize
sequelize-cli
serve-static
set-blocking
set-value
setprototypeof
shebang-command
shebang-regex
shell-quote
shelljs
shimmer
shx
sigmund
signal-exit
simple-swizzle
sinon
slice-ansi
snapdragon
snapdragon-node
snapdragon-util
socket.io-client
socket.io-parser
sort-object-keys2
source-map
source-map-resolve
source-map-url
spawn-wrap
spdx-correct
spdx-exceptions
spdx-expression-parse
spdx-license-ids
split-ca
split-string
split2
sprintf-js
sqlite3
ssf
sshpk
stack-trace
static-extend
statuses
str-util
stream-pipe
string-natural-compare
string-width
string.prototype.padend
string.prototype.trimleft
string.prototype.trimright
string_decoder
strip-ansi
strip-bom
strip-eof
strip-indent
strip-json-comments
superagent
supertest
supports-color
table
taffydb
tar
tar-fs
tar-stream
teeny-request
term-size
terraformer
terraformer-wkt-parser
test-exclude
text-hex
text-table
through
through2
timed-out
timers-ext
tinytim
tmp
to-array
to-buffer
to-fast-properties
to-object-path
to-regex
to-regex-range
toidentifier
topo
toposort-class
touch
tough-cookie
tracer
trim-newlines
triple-beam
ts-enum-util
ts-type
tslib
tunnel-agent
tweetnacl
type
type-check
type-detect
type-is
typedarray
typedarray-dts
uc.micro
uglify-js
umzug
undefsafe
underscore
uni-string
union-value
unique-string
universalify
unpipe
unset-value
unzip-response
upath
upath2
update-notifier
uri-js
urix
url-parse-lax
urlgrey
use
util-deprecate
utils-merge
uuid
validate-npm-package-license
validator
vary
verror
webcrypto-core
which
which-module
wide-align
widest-line
winston
winston-transport
wkx
wordwrap
wrap-ansi
wrappy
write
write-file-atomic
ws
xdg-basedir
xlsx
xmlcreate
xmlhttprequest-ssl
xtend
y18n
yallist
yargs
yargs-parser
yeast
zlibjs
$ npm run prettier-check

> gladys-server@ prettier-check /builds/********/Gladys/server
> prettier --check '**/*.js' '**/*.json'

Checking formatting...
All matched files use Prettier code style!
$ npm run eslint

> gladys-server@ eslint /builds/********/Gladys/server
> eslint .


/builds/********/Gladys/server/services/mqtt/index.js
  6:24  error  Unable to resolve path to module 'mqtt'  import/no-unresolved

/builds/********/Gladys/server/services/philips-hue/index.js
  8:29  error  Unable to resolve path to module 'node-hue-api'  import/no-unresolved

/builds/********/Gladys/server/services/philips-hue/lib/light/index.js
  1:28  error  Unable to resolve path to module 'bottleneck/es5'  import/no-unresolved

/builds/********/Gladys/server/services/rtsp-camera/index.js
  6:26  error  Unable to resolve path to module 'fluent-ffmpeg'  import/no-unresolved

/builds/********/Gladys/server/services/telegram/index.js
  10:31  error  Unable to resolve path to module 'node-telegram-bot-api'  import/no-unresolved

/builds/********/Gladys/server/services/usb/api/usb.controller.js
  13:17  warning  Unexpected unnamed function  func-names

/builds/********/Gladys/server/services/usb/index.js
  5:30  error  Unable to resolve path to module 'serialport'  import/no-unresolved

/builds/********/Gladys/server/services/zwave/index.js
  7:25  error  Unable to resolve path to module 'openzwave-shared'  import/no-unresolved

/builds/********/Gladys/server/test/benchmark/triggers.js
  68:8  warning  Unexpected constant condition  no-constant-condition

/builds/********/Gladys/server/test/lib/gateway/GladysGatewayClientMock.test.js
  4:33  warning  Unexpected unnamed function  func-names

✖ 10 problems (7 errors, 3 warnings)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gladys-server@ eslint: `eslint .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gladys-server@ eslint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-12-06T15_07_56_639Z-debug.log
ERROR: Job failed: exit code 1

Reste à savoir s’il y a des différences entre les images circleci\node:12 et node:12

J’ai également mis en cache les dossiers server/node_modules et front/node_modules

Apparemment, il faudrait installer le module ‘eslint-plugin-import’.
Par contre, je ne sais pas pourquoi…

J’ai pu réglé mes soucis sur la tache de build, maintenant l’image de Gladys que j’obtiens démarre correctement.

Concernant la tâche test_server ça avance également, j’ai pu passé l’eslint en lançant npm run postinstall

Maintenant les error Unable to resolve path to module 'something' import/no-unresolved ont disparu, et c’est le test coverage qui plante à ce niveau :

 PATCH /api/v1/house/test-house
    1) "before each" hook: beforeEach for "should update a house"


  39 passing (4m)
  1 failing

  1) "before each" hook: beforeEach for "should update a house":
     Error: Timeout of 8000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
      at listOnTimeout (internal/timers.js:531:17)
      at processTimers (internal/timers.js:475:7)