Comments (9)
Thanks. I will have to do some digging before I can answer your questions (mostly because I am not the designer of the CI environment). I think your decision to move the knapsack_pro files out of the tmp directory is wise. I just have to figure out what I need to change on my end. Cheers.
from knapsack_pro-ruby.
Solved the problem by changing the directory permissions and making the .knapsack_pro
writable.
There are minimal advantages to making the project directory read-only. Thanks for your help and your product. Cheers.
from knapsack_pro-ruby.
Hi @amckinnell
What do you mean by root directory? Is it your project directory (for example /home/project_repo/
)?
What is your environment for running tests? Is this a business reason to not allow to write to your project directory?
knapsack_pro gem creates .knapsack_pro
directory inside of your project directory like /home/project_repo/.knapsack_pro
.
I moved on purpose knapsack_pro temporary files outside of user project's tmp
directory because often people had code in tests that cleans up tmp
folder and this was messing up with knapsack_pro behaviour.
Configuring your own path to a temporary directory other than .knapsack_pro
could be a feature but maybe it's easier to just change the config on your CI and allow write files to .knapsack_pro
directory?
Even if there was a way to configure a custom path to .knapsack_pro
directory then what would you prefer to set it to? Is it tmp/.knapsack_pro
? Then there is a risk that your tests could accidentally remove knapsack_pro temp files at some point in the future if someone won't be careful. If you use a different path than tmp/.knapsack_pro
then you still need to tell your CI to allow write to that new directory.
from knapsack_pro-ruby.
I'm glad you solved the issue. :)
from knapsack_pro-ruby.
I know this issue was already closed but I find this new behaviour to be surprising and would also appreciate you reconsidering your decision. We also had to alter our CI config to enable this change.
Temp files going to the tmp directory is the expected norm. This breaking because someone has configured hooks to clear tmp directories on spec runs feels like something they should be less surprised about than stashing these files under some directory we create from wherever knapsack is run.
from knapsack_pro-ruby.
Hi @charles-ferguson and thank you for sharing the info. I was not aware that this change to keep files in project_dir/.knapsack_pro
instead of project_dir/tmp/knapsack_pro
could cause some problems.
Could you tell me more about what error did you see? Is it also related to permission access?
I'm wondering why is that. What environment do you use? What CI provider? Do you use docker?
How did you solve the issue? What have you added to your CI pipeline steps to make it work?
I was inspired by the fact that many CI providers use directories like .circleci
, .buildkite
, .github
in the Rails project directory. So I decided to use .knapsack_pro
directory in your project directory.
Temp files going to the tmp directory is the expected norm.
I'm wondering maybe instead of using Rails tmp
directory we could use /tmp
in OS. But this assumes you run knapsack_pro in UNIX environment. Or maybe knapsack_pro could check if /tmp
directory exists before using it.
Do you have any other ideas about what we could try?
I don't know what was the root issue that you had. Would using /tmp
in OS could also cause the same issue for you?
Another idea, maybe during the installation of knapsack_pro we should ask users to create .knapsack_pro
directory within their project folder. This way the directory would exist and be committed into repo and tmp files could be written to it later on. (or maybe that's a false assumption and there would still be an issue with writing new files to such preexisting project_dir/.knapsack_pro
directory)?
This breaking because someone has configured hooks to clear tmp directories on spec runs feels like something they should be less surprised about than stashing these files under some directory we create from wherever knapsack is run.
I was also hoping that people should be less surprised but I saw many times people frustrated that knapsack_pro was not work when project_dir/tmp/knapsack_pro
directory was used. The problem was with missing files in project_dir/tmp/knapsack_pro
because RSpec hooks or someone in the spec wrote code to clean up project_dir/tmp
. This was hard to find and time-consuming and frustrating for users. People assume whatever is in project_dir/tmp
could be removed. There were even cases when knapsack_pro was working fine but some times later someone wrote new tests and started removing files from project_dir/tmp
and this caused knapsack_pro not to work as expected.
I'd appreciate your feedback so we could make a better decision about how to improve knapsack_pro gem. Thank you.
from knapsack_pro-ruby.
Not sure if related, but I will go ahead and post a similar issue I had anyway...
Upgrading to 3.1.0 actually worked fine for me, but there was some permission issue while deleting a file in the /tmp
directory after I set KNAPSACK_PRO_FIXED_QUEUE_SPLIT
to true
in my Docker compose YAML file.
The error I was having on Buildkite was:
Failure/Error: File.delete(path) if File.exist?(path)
Errno::EPERM:
Operation not permitted @ apply2files - /tmp/MY_FILE_NAME
It worked without a problem before configuring the KNAPSACK_PRO_FIXED_QUEUE_SPLIT
option.
from knapsack_pro-ruby.
Hi @lckevin27
This looks like a related issue. Can you share the full error from your CI here or over to support if it contains sensitive data https://knapsackpro.com/contact ?
I'm wondering why there is the path /tmp/MY_FILE_NAME
. We don't write to that file nor delete it. Only to your project directory project_dir/.knapsack_pro
.
Have you solved the issue? How did you solve it?
I guess it is somehow specific to Docker but I'm not that familiar with Docker. Is your project mounted as a volume or copied inside of the docker container? Maybe this could cause a problem and the project is only for reading and nothing can be written to it so temp files can't be deleted.
from knapsack_pro-ruby.
story
For internal tracking of this issue:
https://trello.com/c/su0Oos27
from knapsack_pro-ruby.
Related Issues (20)
- Docs need to specify ENV var to detect CI provider HOT 1
- Fail gracefully when there's no git HOT 8
- Running `git fetch --shallow-since` to fetch commit author log causes hang on Buildkite runners HOT 12
- rspec-core conflict HOT 4
- Running queue mode locally for troubleshooting with a small subset of tests, but with multiple batches HOT 6
- Does `rake knapsack_pro:rspec_test_example_detector` need to run if there aren't any slow specs? HOT 2
- Slow test analysis runs even when there's no slow tests HOT 2
- Disable example_status_persistence_file_path HOT 3
- Create a replication command on failed node HOT 2
- Incompatibility with rspec --options on 6.0+ HOT 11
- NoMethodError: undefined method `rspec_is_quitting' HOT 2
- NoMethodError: undefined method `rspec_is_quitting' for RSpec::Core::World HOT 1
- After upgrading to minitest 5.22.0 I get error status even if all test pass HOT 8
- NoMethodError: undefined method `keys' for nil HOT 20
- Failing RSpec tests on ~>7.0.0 HOT 9
- DataDog dropping RSpec tests with the knapsack_pro 7.x gem in Queue Mode HOT 1
- Knapsack v7 ignores run options defined in spec_helpers. HOT 3
- Ruby 3.3 support? HOT 4
- Simplecov doesnt work with Knapsack Pro 7.4 and minitest HOT 16
- Improve handling of skipped tests and dynamic parallelism HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knapsack_pro-ruby.