bigbite / wp-cypress

WordPress end to end testing with Cypress.io.
MIT License
86 stars 19 forks source link

Unable to run wp-cypress on Circle CI #42

Closed danrhjones closed 3 years ago

danrhjones commented 4 years ago

Describe the bug When running wp-cypress on a circle CI build I get the following error:

`#!/bin/bash -eo pipefail yarn run wp-cypress start yarn run v1.22.5 warning package.json: No license field $ /home/circleci/project/node_modules/.bin/wp-cypress start

See logs for more info: /home/circleci/project/node_modules/@bigbite/wp-cypress/debug.log error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

To Reproduce https://github.com/danrhjones/wp-cypress-circleci https://app.circleci.com/pipelines/github/danrhjones/wp-cypress-circleci/2/workflows/bbd9da79-0bc5-49c3-9010-ac7898178325/jobs/2

Expected behavior I expect that wp-cypress should build the docker container and the tests should be able to be run

danrhjones commented 3 years ago

I have also tried using a machine executor and get a different error

https://app.circleci.com/pipelines/github/danrhjones/wp-cypress-circleci/24/workflows/c130d12e-041b-4b16-9d41-7549c00cab84/jobs/25

https://github.com/danrhjones/wp-cypress-circleci/tree/testing

` Installing dependencies wp-cypress ✔ Dependencies installed

`

jasonagnew commented 3 years ago

Hi @danrhjones

We are working on the issue and hope to have a fix today.

Thanks Jason

jasonagnew commented 3 years ago

Hi @danrhjones

Apologies for the delay on this. CircleCI poses a few issues if not using the machine option. We've made some changes which are yet to be released but you can use them by:

npm uninstall @bigbite/wp-cypress
npm install --save https://github.com/bigbite/wp-cypress.git\#feature/no-volumes

OR

yarn remove @bigbite/wp-cypress
yarn add https://github.com/bigbite/wp-cypress.git\#feature/no-volumes

I took your repo and made the change and confirm it runs: https://github.com/bigbite/wp-cypress-issue-42

As for the docker option on CircleCI it has two limitations, doesn't support volumes and it doesn't allow ports to be open between current docker image and remote docker (wp-cypress). In those changes mention above we added a --no-volumes flag to the start command yarn run wp-cypress start --no-volumes which allows wp-cypress to pass the point mentioned in your issue but there is no way to run the tests as cypress cannot access localhost. However it is not yet clear how to overcome the port issue yet but we will continue looking into it.

Thanks Jason