Skip to content

Commit

Permalink
[POC] Setup Rake task
Browse files Browse the repository at this point in the history
Because I am tired of doing `bash -l`... for cross repo tests...

Edit:   Well... apparently it is required for anything `nvm` related...
Edit 2: `nvm` seems to install then use, so just makes sense to have
        this as one step.
Edit 3: `nvm` is a function, so have to source it first... ugh
Edit 4: Set PATH for node.  Add spec:cypress:ci exec task (sets path)
Edit 5: Debugging...
Edit 6: Forgot to add `../bin`... derp
Edit 7: Call seed prior to spec:cypress to avoid DB loaded errors

"DB loaded errors come from the following task:

    app:test:verify_no_db_access_loading_rails_environment
  • Loading branch information
NickLaMuro committed Jul 31, 2020
1 parent 57f5e31 commit 65de6ff
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ namespace :spec do
desc "Run all cypress specs"
task :cypress => ["app:cypress:ui:run"]

namespace :cypress do
task :ci => ["ci:set_node_path", "app:cypress:ui:seed", "spec:cypress"]

task "ci:install_yarn" do
sh "/bin/bash", "-c", "source ~/.nvm/nvm.sh && nvm install 12 && npm install -g yarn"
end

task "ci:set_node_path" do
ENV["PATH"] = "#{Dir.glob("/home/travis/.nvm/versions/node/v12*").sort.last}/bin:#{ENV["PATH"]}"
# puts;puts;puts
# puts ">>>>>> PATH: #{ENV["PATH"]}"
# puts;puts;puts
end

desc "Setup for CI"
task "ci:setup" => ["ci:install_yarn", "ci:set_node_path", "update:ui"]
end

desc "Try to compile assets"
task :compile => ["app:assets:precompile"]

Expand Down

0 comments on commit 65de6ff

Please sign in to comment.