We've moved discussions to Discord

Github Task to Run Tests Aborted @ `Run bin/rails db:test:prepare`

Jason Ackerman
Any ideas on what is causing this? It prevents the tests from running when I push to Github:

Here's the output on the Github task. Thanks!

Run tests
Run bin/rails db:test:prepare
  bin/rails db:test:prepare
  bin/rails test
  shell: /bin/bash -e {0}
  env:
    PATH: /home/runner/.rubies/ruby-2.7.1/bin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin
    DATABASE_URL: [I removed this for the post, if you need it to answer the question let me know]
    REDIS_URL: [I removed this for the post, if you need it to answer the question let me know]
    RAILS_ENV: test
    RAILS_MASTER_KEY: 
    PG_USER: postgres
/home/runner/work/orgchart/orgchart/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.2/lib/active_record/type.rb:27: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/runner/work/orgchart/orgchart/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.2.2/lib/active_record/type/adapter_specific_registry.rb:9: warning: The called method `add_modifier' is defined here
rails aborted!
ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage
Chris Oliver
Anytime you see this, it means you forgot your RAILS_MASTER_KEY (or have the wrong one):

ActiveSupport::MessageEncryptor::InvalidMessage: ActiveSupport::MessageEncryptor::InvalidMessage

On CI, you need it to be the config/credentials/test.key contents.

That's normally set as a Secret in GitHub Actions.
Jason Ackerman
Success, thanks Chris!
Jason Ackerman
Chris Oliver  Just a thought, would be cool if I could mark this thread as "Solved" or "Answered" so that discussions can be filtered based on answered or unanswered. Would also be a nice way for people looking to help out to find unanswered questions :)
Chris Oliver
Agreed! And a fix for that text that doesn't wrap would be even better. 😅

I'll try and do those both soon.
Jason Ackerman
Thanks again for your help on this Chris Oliver ! I got this working, but I'm now running into a new problem with CI. All of my tests pass locally, but they fail when I push to GitHub with this error:

/home/runner/work/_temp/2f32e900-efb6-44e0-baab-79a0e126c1a1.sh: line 1:  3527 Aborted                 (core dumped)
bin/rails db:test:prepare

2017Error: Process completed with exit code 134.

Any idea why this would have started failing now? Thanks!
Notifications
You’re not receiving notifications from this thread.