Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci failing with missing file error #166

Closed
tachyons opened this issue Dec 30, 2021 · 4 comments
Closed

Ci failing with missing file error #166

tachyons opened this issue Dec 30, 2021 · 4 comments
Labels

Comments

@tachyons
Copy link

I am experimenting with knapsack pro for a project with circleci. My tests are randomly failing with this error. am i missing some configurations ?

Errno::ENOENT: No such file or directory @ rb_sysopen - .knapsack_pro/tracker/prerun_tests_RSpecAdapter_node_1.json

@ArturT
Copy link
Member

ArturT commented Jan 18, 2022

This looks similar to the error from another user #165

Most likely you have a typo in the bind method called in spec helper:

Please add at the beginning of your spec/rails_helper.rb or spec/spec_helper.rb:

require 'knapsack_pro'
KnapsackPro::Adapters::RSpecAdapter.bind

This is from the installation guide: https://docs.knapsackpro.com/knapsack_pro-ruby/guide/

Please ensure the name of RSpec has 2 capital letters RS in the RSpecAdapter name.

Let me know if this helps.

@tachyons
Copy link
Author

tachyons commented Jan 19, 2022

That is unlikely to be the case as I have written the correct name
Screenshot 2022-01-19 at 6 36 44 AM

@ArturT
Copy link
Member

ArturT commented Jan 19, 2022

By any chance do you see errors about no access permission while writing to the directory .knapsack_pro?

knapsack_pro gem creates the .knapsack_pro directory for temporary files inside of your project directory.

I'm wondering if your issue could be related to this #158

Could you share all errors you see (full backtrace). If you don't want to share it publicly please send an email to the support https://knapsackpro.com/contact
I could also check what's recorded on our API side for your account by knowing your email address.

@ArturT
Copy link
Member

ArturT commented Feb 7, 2022

This issue has been solved. The root cause of the issue was that Dir.pwd was getting reset in one spec which caused the knapsack_pro gem process to not find the .knapsack directory as knapsack_pro uses a relative path to fetch config. Dir.chdir with a block in the user's codebase is not thread-safe by design.

@ArturT ArturT closed this as completed Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants