Immutable solution version
Starting a rails test server with Cypress on CI
Complete solution
Starting a rails test server with Cypress on CI: I ended up adding RAILS_ENV=test bundle exec rails server -p 3000 -d so it runs in the background, then kill -9 $(cat tmp/pids/server.pid) for the after job command (once rspec/cypress are done runnin
I ended up adding RAILS_ENV=test bundle exec rails server -p 3000 -d so it runs in the background, then kill -9 $(cat tmp/pids/server.pid) for the after job command (once rspec/cypress are done running)
Context: I can run cypress locally if I start a rails server using RAILS_ENV=test rails server , and then running the cypress run but I am lost on how to do this on CI. I'm using SemaphoreCI which allows me to have setup commands before I run rspec: $ bundle install $ npm install $ bundle exec rake db:create db:migrate db:test:prepare --trace Followed by the actual jobs: $ bundle exec rspec According to cypress , I can't use cy.exec() to start a rails server and I can't run rails serv
Matched source
Source: Source: https://stackoverflow.com/questions/51661617/starting-a-rails-test-server-with-cypress-on-ci Original query: "Starting a rails test server with Cypress on CI" Key terms: cypress, rails, server, starting, test
Evidence
Source: I can run cypress locally if I start a rails server using RAILS_ENV=test rails server , and then running the cypress run but I am lost on how to do this on CI. I'm using SemaphoreCI which allows me to have setup commands before I run rspec: $ bundle install $ npm install $ bundle exec rake db:create db:migrate db:test:prepare --trace Followed by the actual jobs: $ bundle exec rspec According to cypress , I can't use cy.exec() to start a rails server and I can't run rails serv
Verified resolution: I ended up adding RAILS_ENV=test bundle exec rails server -p 3000 -d so it runs in the background, then kill -9 $(cat tmp/pids/server.pid) for the after job command (once rspec/cypress are done running)
Source URL: https://stackoverflow.com/questions/51661617/starting-a-rails-test-server-with-cypress-on-ci
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_2Xb5mHMeIpeb2cYDoqvDAQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Starting a rails test server with Cypress on CI <span>— Vectle</span></a>