Comments (11)
I will try queue mode! I was going to follow up with some additional info, but you got to the same conclusion :).
from knapsack_pro-ruby.
I think it is a bug in our code. The extra --format progress
option is added when formatters are empty but we don't check if someone passed --format
option, or --options .rspec_custom_file
that has --format
inside of the file.
It was introduced here for Regular Mode.
I notice also issue for Queue Mode.
I reported this in the internal ticket.
@irphilli Please use inline options. Thanks to that, the --format
option is applied.
Example:
# Queue Mode (--format documentation is applied inline)
bundle exec rake "knapsack_pro:queue:rspec[--options .rspec_custom.options --format RspecJunitFormatter --out tmp/rspec.xml --format documentation]"
# Regular Mode (--format documentation is applied inline)
bundle exec rake "knapsack_pro:rspec[--options .rspec_custom.options --format RspecJunitFormatter --out tmp/rspec.xml --format documentation]"
from knapsack_pro-ruby.
Hi @irphilli
I can't reproduce the issue. I tested this locally and it seems to work for Queue Mode and Regular Mode.
Can you share the Knapsack Pro command that you use to run tests?
Do you use this configuration here? https://docs.knapsackpro.com/ruby/rspec/#formatters-rspec_junit_formatter-json
from knapsack_pro-ruby.
Thanks for looking into it! I'm using something similar with a file for the options with: knapsack_pro:rspec[--options ./.rspec]
I also have some custom reporters that might be part of the issue, but the non-custom part of the config is:
-r rspec_junit_formatter
--format RspecJunitFormatter
--out tmp/rspec/junit.xml
--format documentation
I'll take a look at some of the custom reporters I have if it can't be reproduced.
from knapsack_pro-ruby.
Looking further into the test output, it looks like --format documentation
isn't working as expected either! So, it seems like maybe something is off with using --options
.
from knapsack_pro-ruby.
What is your RSpec version?
I created a script to run Knapsack Pro with the RSpec --options
provided, and the JUnit XML file is generated correctly.
KnapsackPro/rails-app-with-knapsack_pro@675a118
I'm not sure how to reproduce the issue.
Can you share more details about your config? What's the content of rails_helper.rb/spec_helper.rb
. What are your custom formatters. The full list of options that are provided to the Knapsack Pro command.
If that's private data, you can share it with the support email https://knapsackpro.com/contact
You can also look at recent changes we did in 6.x version of the knapsack_pro gem. We added a custom RSpec formatter to track tests execution time. Maybe this is causing some conflict with your formatters.
-
CHANGELOG https://github.com/KnapsackPro/knapsack_pro-ruby/blob/master/CHANGELOG.md#600
-
the new formatter added https://github.com/KnapsackPro/knapsack_pro-ruby/pull/229/files#diff-224867ff67d486513c374ab2291d9d98db5a02b567424f0e282dcc90988df458R1
from knapsack_pro-ruby.
Here are my versions:
RSpec 3.12
- rspec-core 3.12.2
- rspec-expectations 3.12.3
- rspec-mocks 3.12.6
- rspec-rails 6.1.0
- rspec-support 3.12.1
Seems like maybe just something up with my particular setup specifically (will dig into that more). I've trimmed down the options file to:
--format documentation
And, the output is not coming out in the "documentation" format, when run like: knapsack_pro:rspec[--options ./.rspec]
. However, when run like knapsack_pro:rspec[--format documentation]
, it outputs as expected.
from knapsack_pro-ruby.
If the --format documentation
is present in the ./.rspec
file then the output should be in the documentation format. Is --format documentation
inside of the ./.rspec
file?
This is how I use options: https://github.com/KnapsackPro/rails-app-with-knapsack_pro/blob/1f217df18c71db7dae01f28f89a0e394b33a2a61/bin/knapsack_pro_queue_rspec_junit_with_rspec_custom_options#L18
Maybe you should use .rspec
instead of ./.rspec
. Why do you add ./
?
Please try bundle exec rake "knapsack_pro:rspec[--options .rspec]"
. Please remember to add "
to wrap the options passed to the knapsack_pro command. Otherwise the options won't work.
from knapsack_pro-ruby.
@irphilli I got an email notification that you were asking about:
Looking at the command generated by the runner:
/usr/local/bin/ruby -I/app/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/lib:/app/vendor/bundle/ruby/3.2.0/gems/rspec-support-3.12.1/lib /app/vendor/bundle/ruby/3.2.0/gems/rspec-core-3.12.2/exe/rspec --format documentation --options .rspec --format progress --format KnapsackPro::Formatters::TimeTracker --default-path spec ...
It looks like an extra --format progress is getting inserted (overrides --format documentation). This doesn't yet explain my original issue, but seems like there is something different in the generated command with 6.0+ when it comes to the format options.
If a formatter is not detected in Regular Mode then --format progress
is added as a default formatter. It seems that --options .rspec
is not loaded as the RSpec configuration option, and the --format documentation
could not be detected. It's something that we could improve here:
https://github.com/KnapsackPro/knapsack_pro-ruby/pull/229/files#diff-23b86e488780bfc91dda40439ac5e4f6be1c67e0739bad6c286d36bae402adf3R54
Do you see a similar issue for Queue Mode: bundle exec rake "knapsack_pro:queue:rspec"
?
from knapsack_pro-ruby.
So, I do see the same issue in queue mode, but looks like it was already like that in 5.x.
Going back to standard mode, I went ahead and got rid of our options file (passed in arguments directly), and things are working fine, even with the custom reporters. The only strange thing is that the generated rspec command still has an extra --format progress
in there.
from knapsack_pro-ruby.
I'm closing this in favor of using inline options as in the above example.
from knapsack_pro-ruby.
Related Issues (20)
- 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
- 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 12
- knapsack_pro 7.6.1 fails with RSpec HOT 3
- Custom minitest reporter is run once on the first split, twice on the second, ..., N times on the Nth split HOT 1
- feature request: fail fast across nodes HOT 12
- Infinite recursion when KNAPSACK_PRO_LOG_LEVEL is set to debug HOT 2
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.