We've moved discussions to Discord

github actions test fail

Ugurcan Kaya
Run bin/rails db:test:prepare 
bin/rails db:test:prepare 
bin/rails test 
shell: /bin/bash -e {0} 

env: 
 DATABASE_URL: postgres://postgres:@localhost:5432/jumpstart_test
 REDIS_URL: redis://localhost:6379/0 
 RAILS_ENV: test 
 RAILS_MASTER_KEY: *** 
 PG_USER: postgres 

/home/runner/work/_temp/93d6f9fd-d3bb-4deb-904f-16f5fcff085f.sh: line 1: bin/rails: Permission denied 

##[error]Process completed with exit code 126.

how can we fix this?  
Chris Oliver
It sounds like it's saying your bin/rails file is not marked as executable.

Try this: 
git update-index --chmod=+x bin/rails 
Ugurcan Kaya
it did not work. Same error.

What else can it be?
Chris Oliver
I just ran the tests on my repo and it worked just fine. 

Not sure what's up with yours but definitely a permissions issue. After running the update-index, you pushed that change to github?
Ugurcan Kaya
Yes, I did and same error. So annoying. 

Do I need to make any changes to the github ci template? such as database name etc ?  

or to database.yml ? I am using 5433 port in windows, but it is only set for development. It should not affect the test right?

 


Chris Oliver
Nope.

Make sure all the files in bin are +x though.
Chris Oliver
Looks like git ls-files -s can display permissions bits (first column). Mine are all 100755.

$ git ls-files -s bin
100755 f19acf5b5cc6e80139297e3e6ba9d2fff4153a21 0	bin/bundle
100755 5badb2fde0cb72bbb3cba8436721048dfd7e58dd 0	bin/rails
100755 d87d5f578104597c1d1b951b55942e37f8af1277 0	bin/rake
100755 51140427bbf3f87060498d8545b8c408069457eb 0	bin/setup
100755 fb2ec2ebb48dfade14242dea0add2d98d235a6cb 0	bin/spring
100755 58bfaed518c131bea0d7cde6052923de54620523 0	bin/update
100755 008ecb22f7c7d4daadc1b67acf2a1c974bb30729 0	bin/webpack
100755 a931a9b7fc26c5c5d619ee5165734b77b99e8dc2 0	bin/webpack-dev-server
100755 460dd565b4a3dd6c4cb028bc19d78a7c066d3ec8 0	bin/yarn
Ugurcan Kaya
here is mine 

100755 f19acf5b5cc6e80139297e3e6ba9d2fff4153a21 0       bin/bundle
100644 5badb2fde0cb72bbb3cba8436721048dfd7e58dd 0       bin/rails
100755 17240489f64832c9ce080088e27780d3dc3ee29a 0       bin/rake
100755 5853b5ea8757ef2559d99d22830cfe7d8d9818dd 0       bin/setup
100755 b9c30d2acd051fa96351f3aefa78e8efbba0b536 0       bin/spring
100755 58bfaed518c131bea0d7cde6052923de54620523 0       bin/update
100755 008ecb22f7c7d4daadc1b67acf2a1c974bb30729 0       bin/webpack
100644 a931a9b7fc26c5c5d619ee5165734b77b99e8dc2 0       bin/webpack-dev-server
100755 460dd565b4a3dd6c4cb028bc19d78a7c066d3ec8 0       bin/yarn

Ugurcan Kaya
that was very helpful. 👍

I re-installed atom and that fixed it, for some reason it reverts the permission update after I set line endings 

it works now  thanks!! 
Chris Oliver
Yay!

Wonder why it resets that, strange.
Ugurcan Kaya
not sure. It may be related something else I did but reinstalling git and atom fixed problems. 

and then setting the line endings first and then making files executable did it for me, in case anyone else experience this problem on windows
Ugurcan Kaya
Chris Oliver   test\integration\jumpstart\omniauth_callback_test fails though. 

It cannot find a route for get "/users/auth/developer/callback"

is this about the fixtures?

Chris Oliver
"Developer" is the test Omniauth provider.
Ugurcan Kaya
that's supposed to be generated in setup right? so it should not fail with route error   🤔 

OmniAuth.config.add_mock(:developer, uid: '12345', info: { email: "twitter@example.com" }, credentials: { token: 1 })
Ugurcan Kaya
I see, but I could not get it to pass the test.

Here are errors:

Jumpstart::OmniauthCallbacksTest#test_Cannot_login_with_social_if_email_is_taken_but_not_connected_yet: 

AbstractController::ActionNotFound: The action 'developer' could not be found for Devise::OmniauthCallbacksController 

 test/integration/jumpstart/omniauth_callbacks_test.rb:41:in `block in <class:OmniauthCallbacksTest>' 

Jumpstart::OmniauthCallbacksTest#test_can_register_and_login_with_a_social_account: 

AbstractController::ActionNotFound: The action 'developer' could not be found for Devise::OmniauthCallbacksController 

 test/integration/jumpstart/omniauth_callbacks_test.rb:10:in `block in <class:OmniauthCallbacksTest>'

Jumpstart::OmniauthCallbacksTest#test_can_connect_a_social_account_when_signed_in: 

AbstractController::ActionNotFound: The action 'developer' could not be found for Devise::OmniauthCallbacksController 

 test/integration/jumpstart/omniauth_callbacks_test.rb:31:in `block in <class:OmniauthCallbacksTest>'

Notifications
You’re not receiving notifications from this thread.