testdouble / cypress-rails

Helps you write Cypress tests of your Rails app
Other
321 stars 48 forks source link

cypress:run failing on github actions pipeline #113

Open wagnerpereira opened 2 years ago

wagnerpereira commented 2 years ago

Thank you all for all the work made on this gem. It was time saving coming from Rspec/Capybara.

Do you have any idea why I'm getting this "tail -r" error when running in github actions pipeline?

I didn't get this error when using github.com/cypress-io official github action. But I trying away to generate simplecov coverage report and it didn't works using the cypress github action. I guess it is because it is not terminating the rails server process in the end of the tests.

Github actions running results:

Screen Shot 2022-02-21 at 17 57 36

Github actions Cypress:

Screen Shot 2022-02-21 at 18 02 54

Running on ubuntu:20.04

wagnerpereira commented 2 years ago

The problem seems not to be related exclusively with github actions, it's related with running cypress thought the cypress:run task on linux.

Mac OS has the "tail -r" option, linux don't: Mac OS Monterey:

➜  tia git:(issue-110) cat .tool-versions
ruby 2.7.5
nodejs 12.18.2
redis 6.0.9
➜  tia git:(issue-110) cat .tool-versions | tail -r
redis 6.0.9
nodejs 12.18.2
ruby 2.7.5

Linux Debian / Ubuntu 20.04:

root@1daa76a417c2:/app# cat .tool-versions
ruby 2.7.5
nodejs 12.18.2
redis 6.0.9
root@1daa76a417c2:/app# cat .tool-versions |tail -r
tail: invalid option -- 'r'
Try 'tail --help' for more information.
root@1daa76a417c2:/app#
searls commented 2 years ago

Nothing's jumping out at me as an apparent cause, at least as it pertains to this gem itself. tail isn't referenced anywhere in the gem and I'm unsure what in the combined dependency tree might be trying to invoke it with an invalid (in Linux) flag.

wagnerpereira commented 2 years ago

Thank you @searls, I will continue to debug this.

Yesterday I discovered that if I run the cypress/github-actions before the rake cypress:run, it's works! So I guess that the cypress action knows how to set some aspect of the environment that is lacking when I'm running cypress:run in github action virtual environment.

I'm trying to find what the problem is.

wagnerpereira commented 2 years ago

@searls Trying to read the gem code and check if there is a wait-on method to avoid cypress run start when Rails server is not ready for requests yet ( didn't finish the boot process ). Is there anything like this?

searls commented 2 years ago

Hmm, I don't think so. Seems feasible as an issue, because every Rails app I test with this gem boots much much faster than Cypress itself does

wagnerpereira commented 2 years ago

@searls In fact I have found many issues on cypress github repository with the same > Error: ESOCKETTIMEDOUT on many CI/CD solutions. codebuild, circle CI and github actions.

https://github.com/cypress-io/cypress/issues/7062

I'm still searching to find why this is happening.