Skip to content

Instantly share code, notes, and snippets.

@jplew
Last active January 7, 2020 01:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jplew/280a6ce8710b056bb7238d9a5246cec9 to your computer and use it in GitHub Desktop.
Save jplew/280a6ce8710b056bb7238d9a5246cec9 to your computer and use it in GitHub Desktop.
CI logs
Running with gitlab-runner 12.1.0 (de7731dd)
on uriel c86c7e91
Using Docker executor with image cypress/base:10 ...
Pulling docker image cypress/base:10 ...
Using docker image sha256:e953bc6b70f097730451eb5c33c05a18a7471f1c2cd840e5923224eefa064cdd for cypress/base:10 ...
Running on runner-c86c7e91-project-326-concurrent-0 via ip-10-0-31-218...
Fetching changes...
Reinitialized existing Git repository in /builds/ops/www/.git/
From https://git.cto.ai/ops/www
* [new ref] refs/pipelines/56908 -> refs/pipelines/56908
0a08705..05c491b test-framework-jp -> origin/test-framework-jp
Checking out 05c491b5 as test-framework-jp...
Skipping Git submodules setup
Checking cache for test-framework-jp-2...
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted.
Successfully extracted cache
$ echo "Installing Cypress..."
Installing Cypress...
$ npm ci
> fsevents@1.2.9 install /builds/ops/www/node_modules/fsevents
> node install
> node-sass@4.12.0 install /builds/ops/www/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/linux-x64-64_binding.node
Download complete
Binary saved to /builds/ops/www/node_modules/node-sass/vendor/linux-x64-64/binding.node
Caching binary to /builds/ops/www/.npm/node-sass/4.12.0/linux-x64-64_binding.node
> node-sass@4.12.0 postinstall /builds/ops/www/node_modules/node-sass
> node scripts/build.js
Binary found at /builds/ops/www/node_modules/node-sass/vendor/linux-x64-64/binding.node
Testing binary
Binary is fine
> core-js@2.6.11 postinstall /builds/ops/www/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> dtrace-provider@0.8.7 install /builds/ops/www/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js
make: Entering directory '/builds/ops/www/node_modules/dtrace-provider/build'
TOUCH Release/obj.target/DTraceProviderStub.stamp
make: Leaving directory '/builds/ops/www/node_modules/dtrace-provider/build'
> nodemon@1.19.1 postinstall /builds/ops/www/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
> cypress@3.8.1 postinstall /builds/ops/www/node_modules/cypress
> node index.js --exec install
Note: Overriding Cypress cache directory to: /builds/ops/www/cache/Cypress
Previous installs of Cypress may not be found.
Installing Cypress (version: 3.8.1)
[01:26:32] Downloading Cypress [started]
[01:26:34] Downloading Cypress [completed]
[01:26:34] Unzipping Cypress [started]
[01:27:19] Unzipping Cypress [completed]
[01:27:19] Finishing Installation [started]
[01:27:19] Finishing Installation [completed]
You can now open Cypress by running: node_modules/.bin/cypress open
https://on.cypress.io/installing-cypress
added 1596 packages in 65.104s
$ npx cypress cache path
/builds/ops/www/cache/Cypress
$ npx cypress cache list
3.8.1
$ npm run cypress:verify
> create-next-example-app@ cypress:verify /builds/ops/www
> cypress verify
It looks like this is your first time using Cypress: 3.8.1
[01:27:21] Verifying Cypress can run /builds/ops/www/cache/Cypress/3.8.1/Cypress [started]
[01:27:23] Verifying Cypress can run /builds/ops/www/cache/Cypress/3.8.1/Cypress [completed]
Running after script...
$ rm -rf /root/.ssh
Creating cache test-framework-jp-2...
.npm: found 5491 matching files
cache/Cypress: found 39183 matching files
node_modules: found 41227 matching files
WARNING: /var/cache/apk: not supported: outside build directory
WARNING: /var/cache/apk: no matching files
No URL provided, cache will be not uploaded to shared cache server. Cache will be stored only locally.
Created cache
Job succeeded
@jplew
Copy link
Author

jplew commented Jan 7, 2020

.gitlab-ci.yml

image: alpine:3.9

variables:
  DOCKER_DRIVER: overlay
  SSH_GITLAB_KEY: $SSH_PRIVATE_KEY
  IMAGE_NAME: $CI_PRIVATE_REGISTRY/platform/$CI_PROJECT_NAME
  IMAGE_TAG: $CI_COMMIT_SHORT_SHA
  npm_config_cache: "$CI_PROJECT_DIR/.npm"
  CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"

# cache using branch name
# https://gitlab.com/help/ci/caching/index.md
cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - .npm
    - cache/Cypress
    - node_modules
    - /var/cache/apk

stages:
  - install
  - test

install-cypress:
  before_script:
    - echo "Installing Cypress..."
  image: cypress/base:10
  stage: install
  script:
    - npm ci
    # check Cypress binary path and cached versions
    # useful to make sure we are not carrying around old versions
    - npx cypress cache path
    - npx cypress cache list
    # - $(npm bin)/print-env CI
    - npm run cypress:verify

# all jobs that actually run tests can use the same definition
test-cypress:
  before_script:
    - echo "Running end-to-end tests with Cypress..."
  image: cypress/base:10
  stage: test
  script:
    # - $(npm bin)/print-env CI
    # start the server in the background
    - npm run build
    - npm start &
    # run Cypress test in load balancing mode
    - npm run e2e
  artifacts:
    when: always
    paths:
      - cypress/videos/**/*.mp4
      - cypress/screenshots/**/*.png
    expire_in: 1 day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment