knapsack_pro 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 607304f7096bd72470d12ddf8e0c7095a2a83cf658dafa3485412e9707fbe6ce
4
- data.tar.gz: 6ed43afdaac1a3aa9ed2882b755e09ebe9e6b53a369a80b050525773088604dc
3
+ metadata.gz: 9207f8f421d46b1760bb1f73849d061d570f92b0f25d6f562786d707404d9de6
4
+ data.tar.gz: d76fa0771d644dcc45b41a471d4196bbe1fd76ec4663a5316d73f60e7f587f42
5
5
  SHA512:
6
- metadata.gz: d1cd9051427897c141ac53f022f9d3d935b173b0a80994bbf51c2b2259d31d2bcc3dea570d269f54c1378beb0bc660a6f962b2b7a5fd57a4ad0ff8e659f3e2b1
7
- data.tar.gz: 4ca79c14f45668118402566f128e534926a06800b369d5918cdc21c36f0ed526f0b6bbd57a24ffa9776eaa21a5558d1ebbe987be45e70a7d9c8381e832facdb6
6
+ metadata.gz: 106bba52089e1f8984ae7b7c0f136d6c66a0196fbbccb070d103ed331fc07d5d63a0618e55e6ec04bbe0531b29f2ba9d3d7306e5d039ccb5a76343688363a922
7
+ data.tar.gz: 3ef0616787f95bbfe59b4837b96947f397c7307f7ae61824fc28126a90c10f252b6d5844153755337baab963cb7ef53b86c05021847fda2725401335730db808
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
- ### unreleased
1
+ # Change Log
2
2
 
3
- * TODO
3
+ ### 1.4.0
4
+
5
+ * Use .test domain for development mode
6
+
7
+ https://github.com/KnapsackPro/knapsack_pro-ruby/pull/76
8
+
9
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v1.3.0...v1.4.0
4
10
 
5
11
  ### 1.3.0
6
12
 
data/README.md CHANGED
@@ -20,12 +20,6 @@ The knapsack_pro gem supports:
20
20
 
21
21
  __Would you like to try knapsack_pro gem?__ You can [get an API token here](http://knapsackpro.com?utm_source=github&utm_medium=readme&utm_campaign=knapsack_pro-ruby_gem&utm_content=get_api_token).
22
22
 
23
- ## Is knapsack_pro gem free?
24
-
25
- * If your __project is open source__ then you can use Knapsack Pro for free. Please let me know via email (arturtrzop@gmail.com) and I will mark your account on KnapsackPro.com as open source.
26
-
27
- * If your __project is commercial__ then I'd like to get feedback from you and work closely together to validate if the solution I'm building provide a value for the users. Switching to a paid plan is a good way to validate that and a way to get support from happy users. Maybe you will be the next one who will join and support the project. Thanks!
28
-
29
23
  # How does knapsack_pro work?
30
24
 
31
25
  ## Basics
@@ -46,6 +40,10 @@ For instance when you run tests with `rake knapsack_pro:rspec`:
46
40
 
47
41
  The knapsack_pro has also [queue mode](#queue-mode) to get an optimal test suite split.
48
42
 
43
+ ## FAQ
44
+
45
+ You can see list of questions for common problems and tips in below [Table of Contents](#table-of-contents). Scroll 1 page down and you will see the FAQ in the table of contents.
46
+
49
47
  # Requirements
50
48
 
51
49
  `>= Ruby 2.0.0`
@@ -119,11 +117,13 @@ The knapsack_pro has also [queue mode](#queue-mode) to get an optimal test suite
119
117
  - [Why my CI build fails when I use Test::Unit even when all tests passed?](#why-my-ci-build-fails-when-i-use-testunit-even-when-all-tests-passed)
120
118
  - [Why I see HEAD as branch name in user dashboard for Build metrics for my API token?](#why-i-see-head-as-branch-name-in-user-dashboard-for-build-metrics-for-my-api-token)
121
119
  - [Why Capybara feature tests randomly fail when using CI parallelisation?](#why-capybara-feature-tests-randomly-fail-when-using-ci-parallelisation)
120
+ - [Why knapsack_pro freezes / hangs my CI (for instance Travis)?](#why-knapsack_pro-freezes--hangs-my-ci-for-instance-travis)
122
121
  - [Queue Mode problems](#queue-mode-problems)
123
122
  - [Why when I use Queue Mode for RSpec then my tests fail?](#why-when-i-use-queue-mode-for-rspec-then-my-tests-fail)
124
123
  - [Why when I use Queue Mode for RSpec then FactoryBot/FactoryGirl tests fail?](#why-when-i-use-queue-mode-for-rspec-then-factorybotfactorygirl-tests-fail)
125
124
  - [Why when I use Queue Mode for RSpec then I see error `superclass mismatch for class`?](#why-when-i-use-queue-mode-for-rspec-then-i-see-error-superclass-mismatch-for-class)
126
125
  - [Why I don't see collected time execution data for my build in user dashboard?](#why-i-dont-see-collected-time-execution-data-for-my-build-in-user-dashboard)
126
+ - [Why all test files have 0.1s time execution for my CI build in user dashboard?](#why-all-test-files-have-01s-time-execution-for-my-ci-build-in-user-dashboard)
127
127
  - [Why when I use Queue Mode for RSpec and test fails then I see multiple times info about failed test in RSpec result?](#why-when-i-use-queue-mode-for-rspec-and-test-fails-then-i-see-multiple-times-info-about-failed-test-in-rspec-result)
128
128
  - [Why when I use Queue Mode for RSpec then I see multiple times the same pending tests?](#why-when-i-use-queue-mode-for-rspec-then-i-see-multiple-times-the-same-pending-tests)
129
129
  - [Does in Queue Mode the RSpec is initialized many times that causes Rails load over and over again?](#does-in-queue-mode-the-rspec-is-initialized-many-times-that-causes-rails-load-over-and-over-again)
@@ -150,6 +150,9 @@ The knapsack_pro has also [queue mode](#queue-mode) to get an optimal test suite
150
150
  - [How to use junit formatter with knapsack_pro queue mode?](#how-to-use-junit-formatter-with-knapsack_pro-queue-mode)
151
151
  - [How to use junit formatter with knapsack_pro queue mode when CI nodes use common local drive?](#how-to-use-junit-formatter-with-knapsack_pro-queue-mode-when-ci-nodes-use-common-local-drive)
152
152
  - [Why `tmp/rspec_final_results.xml` is corrupted when I use junit formatter with knapsack_pro queue mode?](#why-tmprspec_final_resultsxml-is-corrupted-when-i-use-junit-formatter-with-knapsack_pro-queue-mode)
153
+ - [How to use JSON formatter for RSpec?](#how-to-use-json-formatter-for-rspec)
154
+ - [How to use RSpec JSON formatter with knapsack_pro Queue Mode?](#how-to-use-rspec-json-formatter-with-knapsack_pro-queue-mode)
155
+ - [How to use RSpec JSON formatter with knapsack_pro Queue Mode when CI nodes use common local drive?](#how-to-use-rspec-json-formatter-with-knapsack_pro-queue-mode-when-ci-nodes-use-common-local-drive)
153
156
  - [How many API keys I need?](#how-many-api-keys-i-need)
154
157
  - [What is optimal order of test commands?](#what-is-optimal-order-of-test-commands)
155
158
  - [How to set `before(:suite)` and `after(:suite)` RSpec hooks in Queue Mode (Percy.io example)?](#how-to-set-beforesuite-and-aftersuite-rspec-hooks-in-queue-mode-percyio-example)
@@ -193,8 +196,8 @@ end
193
196
 
194
197
  And then execute:
195
198
 
196
- ```
197
- $ bundle install
199
+ ```bash
200
+ bundle install
198
201
  ```
199
202
 
200
203
  If you are not using Rails then add this line at the bottom of `Rakefile`:
@@ -238,7 +241,6 @@ Ensure you have `require false` in your Gemfile for webmock gem (see below) when
238
241
 
239
242
  ```ruby
240
243
  # Gemfile
241
-
242
244
  group :test do
243
245
  gem 'vcr'
244
246
  gem 'webmock', require: false
@@ -350,37 +352,41 @@ __Tip:__ In case you have for instance multiple rspec test suites then prepend e
350
352
 
351
353
  On your CI server run this command for the first CI node. Update `KNAPSACK_PRO_CI_NODE_INDEX` for the next one.
352
354
 
353
- # Step for RSpec
354
- $ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
355
+ ```bash
356
+ # Step for RSpec
357
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
355
358
 
356
- # Step for Cucumber
357
- $ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
359
+ # Step for Cucumber
360
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
358
361
 
359
- # Step for Minitest
360
- $ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
362
+ # Step for Minitest
363
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
361
364
 
362
- # Step for test-unit
363
- $ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:test_unit
365
+ # Step for test-unit
366
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:test_unit
364
367
 
365
- # Step for Spinach
366
- $ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:spinach
368
+ # Step for Spinach
369
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:spinach
370
+ ```
367
371
 
368
372
  You can add `KNAPSACK_PRO_TEST_FILE_PATTERN` if your tests are not in default directory. For instance:
369
373
 
370
- # Step for RSpec
371
- $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_specs/**{,/*/**}/*_spec.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
374
+ ```bash
375
+ # Step for RSpec
376
+ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_specs/**{,/*/**}/*_spec.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
372
377
 
373
- # Step for Cucumber
374
- $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_features/**{,/*/**}/*.feature" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
378
+ # Step for Cucumber
379
+ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_features/**{,/*/**}/*.feature" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
375
380
 
376
- # Step for Minitest
377
- $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_tests/**{,/*/**}/*_test.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
381
+ # Step for Minitest
382
+ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_tests/**{,/*/**}/*_test.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
378
383
 
379
- # Step for test-unit
380
- $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_tests/**{,/*/**}/*_test.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:test_unit
384
+ # Step for test-unit
385
+ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_tests/**{,/*/**}/*_test.rb" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:test_unit
381
386
 
382
- # Step for Spinach
383
- $ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_features/**{,/*/**}/*.feature" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:spinach
387
+ # Step for Spinach
388
+ KNAPSACK_PRO_TEST_FILE_PATTERN="directory_with_features/**{,/*/**}/*.feature" KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:spinach
389
+ ```
384
390
 
385
391
  __Tip:__ If you use one of the supported CI providers then instead of the above steps you should [take a look at this](#supported-ci-providers).
386
392
 
@@ -423,15 +429,19 @@ Please use a separate API token for queue mode from one used already for regular
423
429
 
424
430
  Use this command to run queue mode:
425
431
 
426
- # RSpec >= 3.x
427
- bundle exec rake knapsack_pro:queue:rspec
432
+ ```bash
433
+ # RSpec >= 3.x
434
+ bundle exec rake knapsack_pro:queue:rspec
428
435
 
429
- # Minitest
430
- bundle exec rake knapsack_pro:queue:minitest
436
+ # Minitest
437
+ bundle exec rake knapsack_pro:queue:minitest
438
+ ```
431
439
 
432
440
  If the above command fails then you may need to explicitly pass an argument to require the `rails_helper` file or `spec_helper` in case you are not doing this in some of your test files:
433
441
 
434
- bundle exec rake "knapsack_pro:queue:rspec[--require rails_helper]"
442
+ ```bash
443
+ bundle exec rake "knapsack_pro:queue:rspec[--require rails_helper]"
444
+ ```
435
445
 
436
446
  Note: when you run queue mode command for the first time it might be slower.
437
447
  The second build should have a more optimal test suite split.
@@ -521,6 +531,7 @@ There might be some cached test suite splits for git commits you have run in pas
521
531
  At this moment the queue mode works for:
522
532
 
523
533
  * RSpec
534
+ * Minitest
524
535
 
525
536
  ## Extra configuration for CI server
526
537
 
@@ -569,9 +580,11 @@ Note this is for knapack_pro regular mode only.
569
580
 
570
581
  #### Environment variables for debugging gem
571
582
 
572
- `KNAPSACK_PRO_ENDPOINT` - Default value is `http://api.knapsackpro.com` which is endpoint for [Knapsack Pro API](http://docs.knapsackpro.com).
583
+ This is only for maintainer of knapsack_pro gem. Not for the end users.
584
+
585
+ `KNAPSACK_PRO_ENDPOINT` - Default value is `https://api.knapsackpro.com` which is endpoint for [Knapsack Pro API](http://docs.knapsackpro.com).
573
586
 
574
- `KNAPSACK_PRO_MODE` - Default value is `production`. When mode is `development` then endpoint is `http://api.knapsackpro.dev:3000`. When mode is `test` then endpoint is `http://api-staging.knapsackpro.com`.
587
+ `KNAPSACK_PRO_MODE` - Default value is `production`. When mode is `development` then endpoint is `http://api.knapsackpro.test:3000`. When mode is `test` then endpoint is `http://api-staging.knapsackpro.com`.
575
588
 
576
589
  ### Passing arguments to rake task
577
590
 
@@ -579,55 +592,73 @@ Note this is for knapack_pro regular mode only.
579
592
 
580
593
  Knapsack Pro allows you to pass arguments through to rspec. For example if you want to run only specs that have the tag `focus`. If you do this with rspec directly it would look like:
581
594
 
582
- $ bundle exec rake rspec --tag focus
595
+ ```bash
596
+ bundle exec rake rspec --tag focus
597
+ ```
583
598
 
584
599
  To do this with Knapsack Pro you simply add your rspec arguments as parameters to the knapsack_pro rake task.
585
600
 
586
- $ bundle exec rake "knapsack_pro:rspec[--tag focus]"
601
+ ```bash
602
+ bundle exec rake "knapsack_pro:rspec[--tag focus]"
603
+ ```
587
604
 
588
605
  #### Passing arguments to cucumber
589
606
 
590
607
  Add arguments to knapsack_pro cucumber task like this:
591
608
 
592
- $ bundle exec rake "knapsack_pro:cucumber[--name feature]"
609
+ ```bash
610
+ bundle exec rake "knapsack_pro:cucumber[--name feature]"
611
+ ```
593
612
 
594
613
  #### Passing arguments to minitest
595
614
 
596
615
  Add arguments to knapsack_pro minitest task like this:
597
616
 
598
- $ bundle exec rake "knapsack_pro:minitest[--arg_name value]"
617
+ ```bash
618
+ bundle exec rake "knapsack_pro:minitest[--arg_name value]"
619
+ ```
599
620
 
600
621
  For instance to run verbose tests:
601
622
 
602
- $ bundle exec rake "knapsack_pro:minitest[--verbose]"
623
+ ```bash
624
+ bundle exec rake "knapsack_pro:minitest[--verbose]"
625
+ ```
603
626
 
604
627
  #### Passing arguments to test-unit
605
628
 
606
629
  Add arguments to knapsack_pro test-unit task like this:
607
630
 
608
- $ bundle exec rake "knapsack_pro:test_unit[--arg_name value]"
631
+ ```bash
632
+ bundle exec rake "knapsack_pro:test_unit[--arg_name value]"
633
+ ```
609
634
 
610
635
  For instance to run verbose tests:
611
636
 
612
- $ bundle exec rake "knapsack_pro:test_unit[--verbose]"
637
+ ```bash
638
+ bundle exec rake "knapsack_pro:test_unit[--verbose]"
639
+ ```
613
640
 
614
641
  #### Passing arguments to spinach
615
642
 
616
643
  Add arguments to knapsack_pro spinach task like this:
617
644
 
618
- $ bundle exec rake "knapsack_pro:spinach[--arg_name value]"
645
+ ```bash
646
+ bundle exec rake "knapsack_pro:spinach[--arg_name value]"
647
+ ```
619
648
 
620
649
  ### Knapsack Pro binary
621
650
 
622
651
  You can install knapsack_pro globally and use binary. For instance:
623
652
 
624
- $ knapsack_pro rspec "--tag custom_tag_name --profile"
625
- $ knapsack_pro queue:rspec "--tag custom_tag_name --profile"
626
- $ knapsack_pro cucumber "--name feature"
627
- $ knapsack_pro minitest "--verbose --pride"
628
- $ knapsack_pro queue:minitest "--verbose"
629
- $ knapsack_pro test_unit "--verbose"
630
- $ knapsack_pro spinach "--arg_name value"
653
+ ```bash
654
+ knapsack_pro rspec "--tag custom_tag_name --profile"
655
+ knapsack_pro queue:rspec "--tag custom_tag_name --profile"
656
+ knapsack_pro cucumber "--name feature"
657
+ knapsack_pro minitest "--verbose --pride"
658
+ knapsack_pro queue:minitest "--verbose"
659
+ knapsack_pro test_unit "--verbose"
660
+ knapsack_pro spinach "--arg_name value"
661
+ ```
631
662
 
632
663
  This is optional way of using knapsack_pro when you don't want to add it to `Gemfile`.
633
664
 
@@ -646,7 +677,9 @@ You can generate API key for your test suite in [your dashboard](https://knapsac
646
677
 
647
678
  Next step is to generate salt which will be used to encrypt test files or branch names.
648
679
 
649
- $ bundle exec rake knapsack_pro:salt
680
+ ```bash
681
+ bundle exec rake knapsack_pro:salt
682
+ ```
650
683
 
651
684
  Add to your CI server generated environment variable `KNAPSACK_PRO_SALT`.
652
685
 
@@ -658,7 +691,9 @@ You need to add environment variable `KNAPSACK_PRO_TEST_FILES_ENCRYPTED=true` to
658
691
 
659
692
  If you need to check what is the encryption hash for particular test file you can check that with the rake task:
660
693
 
661
- $ KNAPSACK_PRO_SALT=xxx bundle exec rake knapsack_pro:encrypted_test_file_names[rspec]
694
+ ```bash
695
+ KNAPSACK_PRO_SALT=xxx bundle exec rake knapsack_pro:encrypted_test_file_names[rspec]
696
+ ```
662
697
 
663
698
  You can pass the name of test runner like `rspec`, `minitest`, `test_unit`, `cucumber`, `spinach` as argument to rake task.
664
699
 
@@ -678,11 +713,13 @@ Note: there are a few branch names that won't be encrypted because we use them a
678
713
 
679
714
  If you need to check what is the encryption hash for particular branch then use the rake task:
680
715
 
681
- # show all local branches and respective hashes
682
- $ KNAPSACK_PRO_SALT=xxx bundle exec rake knapsack_pro:encrypted_branch_names
716
+ ```bash
717
+ # show all local branches and respective hashes
718
+ $ KNAPSACK_PRO_SALT=xxx bundle exec rake knapsack_pro:encrypted_branch_names
683
719
 
684
- # show hash for branch provided as argument to rake task
685
- $ KNAPSACK_PRO_SALT=xxx bundle exec rake knapsack_pro:encrypted_branch_names[not-encrypted-branch-name]
720
+ # show hash for branch provided as argument to rake task
721
+ $ KNAPSACK_PRO_SALT=xxx bundle exec rake knapsack_pro:encrypted_branch_names[not-encrypted-branch-name]
722
+ ```
686
723
 
687
724
  ### Supported CI providers
688
725
 
@@ -728,7 +765,7 @@ test:
728
765
 
729
766
  Here is another example for CircleCI 2.0 platform.
730
767
 
731
- ```YAML
768
+ ```yaml
732
769
  # CircleCI 2.0
733
770
 
734
771
  # some tests that are not balanced and executed only on first CI node
@@ -832,29 +869,31 @@ More info about global and matrix ENV configuration in [travis docs](https://doc
832
869
 
833
870
  Knapsack Pro supports semaphoreapp ENVs `SEMAPHORE_THREAD_COUNT` and `SEMAPHORE_CURRENT_THREAD`. The only thing you need to do is set up knapsack_pro rspec/cucumber/minitest/test_unit command for as many threads as you need. Here is an example:
834
871
 
835
- # Thread 1
836
- ## Step for RSpec
837
- bundle exec rake knapsack_pro:rspec
838
- ## Step for Cucumber
839
- bundle exec rake knapsack_pro:cucumber
840
- ## Step for Minitest
841
- bundle exec rake knapsack_pro:minitest
842
- ## Step for test-unit
843
- bundle exec rake knapsack_pro:test_unit
844
- ## Step for Spinach
845
- bundle exec rake knapsack_pro:spinach
846
-
847
- # Thread 2
848
- ## Step for RSpec
849
- bundle exec rake knapsack_pro:rspec
850
- ## Step for Cucumber
851
- bundle exec rake knapsack_pro:cucumber
852
- ## Step for Minitest
853
- bundle exec rake knapsack_pro:minitest
854
- ## Step for test-unit
855
- bundle exec rake knapsack_pro:test_unit
856
- ## Step for Spinach
857
- bundle exec rake knapsack_pro:spinach
872
+ ```bash
873
+ # Thread 1
874
+ ## Step for RSpec
875
+ bundle exec rake knapsack_pro:rspec
876
+ ## Step for Cucumber
877
+ bundle exec rake knapsack_pro:cucumber
878
+ ## Step for Minitest
879
+ bundle exec rake knapsack_pro:minitest
880
+ ## Step for test-unit
881
+ bundle exec rake knapsack_pro:test_unit
882
+ ## Step for Spinach
883
+ bundle exec rake knapsack_pro:spinach
884
+
885
+ # Thread 2
886
+ ## Step for RSpec
887
+ bundle exec rake knapsack_pro:rspec
888
+ ## Step for Cucumber
889
+ bundle exec rake knapsack_pro:cucumber
890
+ ## Step for Minitest
891
+ bundle exec rake knapsack_pro:minitest
892
+ ## Step for test-unit
893
+ bundle exec rake knapsack_pro:test_unit
894
+ ## Step for Spinach
895
+ bundle exec rake knapsack_pro:spinach
896
+ ```
858
897
 
859
898
  Tests will be split across threads.
860
899
 
@@ -864,20 +903,22 @@ Please remember to set up API token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` a
864
903
 
865
904
  Knapsack Pro supports buildkite ENVs `BUILDKITE_PARALLEL_JOB_COUNT` and `BUILDKITE_PARALLEL_JOB`. The only thing you need to do is to configure the parallelism parameter in your build step and run the appropiate command in your build
866
905
 
867
- # Step for RSpec
868
- bundle exec rake knapsack_pro:rspec
906
+ ```bash
907
+ # Step for RSpec
908
+ bundle exec rake knapsack_pro:rspec
869
909
 
870
- # Step for Cucumber
871
- bundle exec rake knapsack_pro:cucumber
910
+ # Step for Cucumber
911
+ bundle exec rake knapsack_pro:cucumber
872
912
 
873
- # Step for Minitest
874
- bundle exec rake knapsack_pro:minitest
913
+ # Step for Minitest
914
+ bundle exec rake knapsack_pro:minitest
875
915
 
876
- # Step for test-unit
877
- bundle exec rake knapsack_pro:test_unit
916
+ # Step for test-unit
917
+ bundle exec rake knapsack_pro:test_unit
878
918
 
879
- # Step for Spinach
880
- bundle exec rake knapsack_pro:spinach
919
+ # Step for Spinach
920
+ bundle exec rake knapsack_pro:spinach
921
+ ```
881
922
 
882
923
  Please remember to set up API token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` as global environment.
883
924
 
@@ -920,7 +961,7 @@ Here you can find info [how to configure the GitLab parallel CI nodes](https://d
920
961
 
921
962
  GitLab CI does not provide parallel jobs environment variables so you will have to define `KNAPSACK_PRO_CI_NODE_TOTAL` and `KNAPSACK_PRO_CI_NODE_INDEX` for each parallel job running as part of the same `test` stage. Below is relevant part of `.gitlab-ci.yml` configuration for 2 parallel jobs.
922
963
 
923
- ```
964
+ ```yaml
924
965
  # .gitlab-ci.yml
925
966
  stages:
926
967
  - test
@@ -954,7 +995,7 @@ Codeship does not provide parallel jobs environment variables so you will have t
954
995
 
955
996
  Configure test pipelines (1/2 used)
956
997
 
957
- ```
998
+ ```bash
958
999
  # first CI node running in parallel
959
1000
 
960
1001
  # Cucumber tests in Knapsack Pro Regular Mode (deterministic test suite split)
@@ -967,7 +1008,7 @@ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knaps
967
1008
 
968
1009
  Configure test pipelines (2/2 used)
969
1010
 
970
- ```
1011
+ ```bash
971
1012
  # second CI node running in parallel
972
1013
 
973
1014
  # Cucumber tests in Knapsack Pro Regular Mode (deterministic test suite split)
@@ -994,7 +1035,7 @@ For any sensitive environment variables (like Knapsack Pro API token) that you d
994
1035
 
995
1036
  Note the [Heroku CI Parallel Test Runs](https://devcenter.heroku.com/articles/heroku-ci-parallel-test-runs) are in Beta and you may need to ask Heroku support to enabled it for your project.
996
1037
 
997
- ```
1038
+ ```json
998
1039
  # app.json
999
1040
  {
1000
1041
  "environments": {
@@ -1024,30 +1065,32 @@ You can learn more about [Heroku CI](https://devcenter.heroku.com/articles/herok
1024
1065
 
1025
1066
  [Solano CI](https://www.solanolabs.com) does not provide parallel jobs environment variables so you will have to define `KNAPSACK_PRO_CI_NODE_TOTAL` and `KNAPSACK_PRO_CI_NODE_INDEX` for each parallel job running as part of the same CI build.
1026
1067
 
1027
- # Step for RSpec for first CI node
1028
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
1029
- # Step for RSpec for second CI node
1030
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:rspec
1068
+ ```bash
1069
+ # Step for RSpec for first CI node
1070
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
1071
+ # Step for RSpec for second CI node
1072
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:rspec
1031
1073
 
1032
- # Step for Cucumber for first CI node
1033
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
1034
- # Step for Cucumber for second CI node
1035
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:cucumber
1074
+ # Step for Cucumber for first CI node
1075
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
1076
+ # Step for Cucumber for second CI node
1077
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:cucumber
1036
1078
 
1037
- # Step for Minitest for first CI node
1038
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
1039
- # Step for Minitest for second CI node
1040
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:minitest
1079
+ # Step for Minitest for first CI node
1080
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
1081
+ # Step for Minitest for second CI node
1082
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:minitest
1041
1083
 
1042
- # Step for test-unit for first CI node
1043
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:test_unit
1044
- # Step for test-unit for second CI node
1045
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:test_unit
1084
+ # Step for test-unit for first CI node
1085
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:test_unit
1086
+ # Step for test-unit for second CI node
1087
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:test_unit
1046
1088
 
1047
- # Step for Spinach for first CI node
1048
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:spinach
1049
- # Step for Spinach for second CI node
1050
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:spinach
1089
+ # Step for Spinach for first CI node
1090
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:spinach
1091
+ # Step for Spinach for second CI node
1092
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:spinach
1093
+ ```
1051
1094
 
1052
1095
  Please remember to set up API token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` as global environment.
1053
1096
 
@@ -1055,30 +1098,32 @@ Please remember to set up API token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` a
1055
1098
 
1056
1099
  [AppVeyor](https://www.appveyor.com) does not provide parallel jobs environment variables so you will have to define `KNAPSACK_PRO_CI_NODE_TOTAL` and `KNAPSACK_PRO_CI_NODE_INDEX` for each parallel job running as part of the same CI build.
1057
1100
 
1058
- # Step for RSpec for first CI node
1059
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
1060
- # Step for RSpec for second CI node
1061
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:rspec
1101
+ ```bash
1102
+ # Step for RSpec for first CI node
1103
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:rspec
1104
+ # Step for RSpec for second CI node
1105
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:rspec
1062
1106
 
1063
- # Step for Cucumber for first CI node
1064
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
1065
- # Step for Cucumber for second CI node
1066
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:cucumber
1107
+ # Step for Cucumber for first CI node
1108
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:cucumber
1109
+ # Step for Cucumber for second CI node
1110
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:cucumber
1067
1111
 
1068
- # Step for Minitest for first CI node
1069
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
1070
- # Step for Minitest for second CI node
1071
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:minitest
1112
+ # Step for Minitest for first CI node
1113
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:minitest
1114
+ # Step for Minitest for second CI node
1115
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:minitest
1072
1116
 
1073
- # Step for test-unit for first CI node
1074
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:test_unit
1075
- # Step for test-unit for second CI node
1076
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:test_unit
1117
+ # Step for test-unit for first CI node
1118
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:test_unit
1119
+ # Step for test-unit for second CI node
1120
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:test_unit
1077
1121
 
1078
- # Step for Spinach for first CI node
1079
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:spinach
1080
- # Step for Spinach for second CI node
1081
- KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:spinach
1122
+ # Step for Spinach for first CI node
1123
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=0 bundle exec rake knapsack_pro:spinach
1124
+ # Step for Spinach for second CI node
1125
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 KNAPSACK_PRO_CI_NODE_INDEX=1 bundle exec rake knapsack_pro:spinach
1126
+ ```
1082
1127
 
1083
1128
  Please remember to set up API token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` as global environment.
1084
1129
 
@@ -1086,20 +1131,22 @@ Please remember to set up API token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` a
1086
1131
 
1087
1132
  Knapsack Pro supports snap-ci.com ENVs `SNAP_WORKER_TOTAL` and `SNAP_WORKER_INDEX`. The only thing you need to do is to configure number of workers for your project in configuration settings in order to enable parallelism. Next thing is to set below commands to be executed in your stage:
1088
1133
 
1089
- # Step for RSpec
1090
- bundle exec rake knapsack_pro:rspec
1134
+ ```bash
1135
+ # Step for RSpec
1136
+ bundle exec rake knapsack_pro:rspec
1091
1137
 
1092
- # Step for Cucumber
1093
- bundle exec rake knapsack_pro:cucumber
1138
+ # Step for Cucumber
1139
+ bundle exec rake knapsack_pro:cucumber
1094
1140
 
1095
- # Step for Minitest
1096
- bundle exec rake knapsack_pro:minitest
1141
+ # Step for Minitest
1142
+ bundle exec rake knapsack_pro:minitest
1097
1143
 
1098
- # Step for test-unit
1099
- bundle exec rake knapsack_pro:test_unit
1144
+ # Step for test-unit
1145
+ bundle exec rake knapsack_pro:test_unit
1100
1146
 
1101
- # Step for Spinach
1102
- bundle exec rake knapsack_pro:spinach
1147
+ # Step for Spinach
1148
+ bundle exec rake knapsack_pro:spinach
1149
+ ```
1103
1150
 
1104
1151
  Please remember to set up API token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` as global environment.
1105
1152
 
@@ -1107,20 +1154,22 @@ Please remember to set up API token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` a
1107
1154
 
1108
1155
  Knapsack Pro supports cirrus-ci.org ENVs `CI_NODE_TOTAL` and `CI_NODE_INDEX`. The only thing you need to do is to configure number of parallel CI nodes for your project. Next thing is to set one of below commands to be executed on each parallel CI node:
1109
1156
 
1110
- # Step for RSpec
1111
- bundle exec rake knapsack_pro:rspec
1157
+ ```bash
1158
+ # Step for RSpec
1159
+ bundle exec rake knapsack_pro:rspec
1112
1160
 
1113
- # Step for Cucumber
1114
- bundle exec rake knapsack_pro:cucumber
1161
+ # Step for Cucumber
1162
+ bundle exec rake knapsack_pro:cucumber
1115
1163
 
1116
- # Step for Minitest
1117
- bundle exec rake knapsack_pro:minitest
1164
+ # Step for Minitest
1165
+ bundle exec rake knapsack_pro:minitest
1118
1166
 
1119
- # Step for test-unit
1120
- bundle exec rake knapsack_pro:test_unit
1167
+ # Step for test-unit
1168
+ bundle exec rake knapsack_pro:test_unit
1121
1169
 
1122
- # Step for Spinach
1123
- bundle exec rake knapsack_pro:spinach
1170
+ # Step for Spinach
1171
+ bundle exec rake knapsack_pro:spinach
1172
+ ```
1124
1173
 
1125
1174
  Please remember to set up API token like `KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` as global environment.
1126
1175
 
@@ -1133,7 +1182,7 @@ You can learn basics about it in the article [Parallelism and Distributed Builds
1133
1182
 
1134
1183
  Here is example `Jenkinsfile` working with Jenkins Pipeline.
1135
1184
 
1136
- ```
1185
+ ```groovy
1137
1186
  timeout(time: 60, unit: 'MINUTES') {
1138
1187
  node() {
1139
1188
  stage('Checkout') {
@@ -1238,6 +1287,19 @@ Capybara.default_max_wait_time = 5 # in seconds
1238
1287
 
1239
1288
  For instance, this tip might be helpful for Heroku CI users who use Heroku dynos with lower performance.
1240
1289
 
1290
+ #### Why knapsack_pro freezes / hangs my CI (for instance Travis)?
1291
+
1292
+ [Freeze error can occur for example on Travis CI](https://docs.travis-ci.com/user/common-build-problems/#ruby-tests-frozen-and-cancelled-after-10-minute-log-silence).
1293
+ The `timecop` gem can result in sporadic freezing due to issues with ordering calls of `Timecop.return`, `Timecop.freeze`, and `Timecop.travel`. For instance, if using RSpec, ensure to have a `Timecop.return` configured to run after all examples:
1294
+
1295
+ ```ruby
1296
+ # in, e.g. spec/spec_helper.rb
1297
+ RSpec.configure do |c|
1298
+ c.after(:all) do
1299
+ Timecop.return
1300
+ end
1301
+ end
1302
+ ```
1241
1303
 
1242
1304
  #### Queue Mode problems
1243
1305
 
@@ -1255,7 +1317,7 @@ You can learn more about [recent RSpec team changes](https://github.com/Knapsack
1255
1317
 
1256
1318
  You can use [knapsack_pro binary](#knapsack-pro-binary) instead of rake task version to solve problem:
1257
1319
 
1258
- ```
1320
+ ```bash
1259
1321
  # knapsack_pro binary for Queue Mode
1260
1322
  $ bundle exec knapsack_pro queue:rspec
1261
1323
  ```
@@ -1295,7 +1357,7 @@ TypeError:
1295
1357
 
1296
1358
  when you have 2 test files like this one:
1297
1359
 
1298
- ```
1360
+ ```ruby
1299
1361
  # spec/a_spec.rb
1300
1362
  class BaseBatchClass
1301
1363
  end
@@ -1315,7 +1377,7 @@ describe 'A test of something' do
1315
1377
  end
1316
1378
  ```
1317
1379
 
1318
- ```
1380
+ ```ruby
1319
1381
  # spec/b_spec.rb
1320
1382
  class DifferentBaseBatchClass
1321
1383
  end
@@ -1346,6 +1408,14 @@ If you go to [user dashboard](https://knapsackpro.com/dashboard) and open `Build
1346
1408
  * you explicitly set `RAILS_ENV=test` on your CI nodes (for instance you use Docker then please set `RAILS_ENV`)
1347
1409
  * knapsack_pro Queue Mode saves temporary files with collected time execution data in `your_rails_project/tmp/knapsack_pro/queue/`. Please ensure you don't clean `tmp` directory in your tests so knapsack_pro can publish time execution data to Knapsack Pro API server.
1348
1410
 
1411
+ ##### Why all test files have 0.1s time execution for my CI build in user dashboard?
1412
+
1413
+ If you go to [user dashboard](https://knapsackpro.com/dashboard) and open `Build metrics` for your API token and you open CI build for your last git commit you should see there info about collected time execution data from all CI nodes. If you see all test files have 0.1s time execution then please ensure:
1414
+
1415
+ * you don't clean up `tmp` directory in your tests (for instance in RSpec hooks like `before` or `after`) so knapsack_pro can publish measured time execution data to Knapsack Pro API server. knapsack_pro Queue Mode saves temporary files with collected time execution data in `your_rails_project/tmp/knapsack_pro/queue/`.
1416
+
1417
+ The 0.1s is a default time execution used when test file is an empty file or its content are all pending tests.
1418
+
1349
1419
  ##### Why when I use Queue Mode for RSpec and test fails then I see multiple times info about failed test in RSpec result?
1350
1420
 
1351
1421
  The problem may happen when you use old knapsack_pro `< 0.33.0` or if you use custom rspec formatter, or when you set flag [KNAPSACK_PRO_MODIFY_DEFAULT_RSPEC_FORMATTERS=false](#knapsack_pro_modify_default_rspec_formatters-hide-duplicated-summary-of-pending-and-failed-tests).
@@ -1378,7 +1448,7 @@ Please [read this](#knapsack_pro_fixed_queue_split-remember-queue-split-on-retry
1378
1448
 
1379
1449
  Please use fixed version of capybara-screenshot.
1380
1450
 
1381
- ```
1451
+ ```ruby
1382
1452
  # Gemfile
1383
1453
  group :test do
1384
1454
  gem 'capybara-screenshot', github: 'mattheworiordan/capybara-screenshot', branch: 'master'
@@ -1433,7 +1503,7 @@ In output for RSpec in knapack_pro Queue Mode you may see message:
1433
1503
 
1434
1504
  The seed number is used by RSpec only when you tell it, you need to provide argument `--order random`:
1435
1505
 
1436
- ```
1506
+ ```bash
1437
1507
  bundle exec rake "knapsack_pro:queue:rspec[--order random]"
1438
1508
  ```
1439
1509
 
@@ -1445,7 +1515,7 @@ Randomized with seed 11055
1445
1515
 
1446
1516
  You can use the seed number to run tests in development:
1447
1517
 
1448
- ```
1518
+ ```bash
1449
1519
  bundle exec rspec --seed 11055 --default-path spec "spec/a_spec.rb" "spec/b_spec.rb"
1450
1520
  ```
1451
1521
 
@@ -1460,12 +1530,14 @@ If you don't use RSpec argument `--order random` then you don't need to provide
1460
1530
  In your development environment you can debug tests that were run on the particular CI node.
1461
1531
  For instance to run subset of tests for the first CI node with specified seed you can do.
1462
1532
 
1463
- KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=token \
1464
- KNAPSACK_PRO_REPOSITORY_ADAPTER=git \
1465
- KNAPSACK_PRO_PROJECT_DIR=~/projects/rails-app \
1466
- KNAPSACK_PRO_CI_NODE_TOTAL=2 \
1467
- KNAPSACK_PRO_CI_NODE_INDEX=0 \
1468
- bundle exec rake "knapsack_pro:rspec[--seed 123]"
1533
+ ```bash
1534
+ KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=token \
1535
+ KNAPSACK_PRO_REPOSITORY_ADAPTER=git \
1536
+ KNAPSACK_PRO_PROJECT_DIR=~/projects/rails-app \
1537
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 \
1538
+ KNAPSACK_PRO_CI_NODE_INDEX=0 \
1539
+ bundle exec rake "knapsack_pro:rspec[--seed 123]"
1540
+ ```
1469
1541
 
1470
1542
  Above example is for RSpec. You can use respectively rake task name and token environment variable when you want to run tests for minitest, test_unit, cucumber or spinach.
1471
1543
  It should work when all CI nodes finished work and sent time execution data to Knapsack Pro API.
@@ -1475,11 +1547,15 @@ If at least one CI node has not sent time execution data to the Knapsack Pro API
1475
1547
  Check test runner output on particular CI node you would like to retry in development. You should see at the beginning of rspec command an output that can
1476
1548
  be copied and executed in development.
1477
1549
 
1478
- /Users/ubuntu/.rvm/gems/ruby-2.4.0/gems/rspec-core-3.4.4/exe/rspec spec/foo_spec.rb spec/bar_spec.rb --default-path spec
1550
+ ```
1551
+ /Users/ubuntu/.rvm/gems/ruby-2.4.0/gems/rspec-core-3.4.4/exe/rspec spec/foo_spec.rb spec/bar_spec.rb --default-path spec
1552
+ ```
1479
1553
 
1480
1554
  Command similar to above can be executed in your development this way:
1481
1555
 
1482
- bundle exec rspec spec/foo_spec.rb spec/bar_spec.rb --default-path spec
1556
+ ```bash
1557
+ bundle exec rspec spec/foo_spec.rb spec/bar_spec.rb --default-path spec
1558
+ ```
1483
1559
 
1484
1560
  If you were running your tests with `--order random` on your CI then you can additionaly pass seed param with proper value in above command (`--seed 123`).
1485
1561
 
@@ -1495,19 +1571,23 @@ There are a few ways to reproduce tests executed on CI node in your development
1495
1571
 
1496
1572
  To retry the particular CI node do this on your machine:
1497
1573
 
1498
- RACK_ENV=test \
1499
- RAILS_ENV=test \
1500
- KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=token \
1501
- KNAPSACK_PRO_REPOSITORY_ADAPTER=git \
1502
- KNAPSACK_PRO_PROJECT_DIR=~/projects/rails-app \
1503
- KNAPSACK_PRO_CI_NODE_TOTAL=2 \
1504
- KNAPSACK_PRO_CI_NODE_INDEX=0 \
1505
- KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true \
1506
- bundle exec rake "knapsack_pro:queue:rspec"
1574
+ ```bash
1575
+ RACK_ENV=test \
1576
+ RAILS_ENV=test \
1577
+ KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=token \
1578
+ KNAPSACK_PRO_REPOSITORY_ADAPTER=git \
1579
+ KNAPSACK_PRO_PROJECT_DIR=~/projects/rails-app \
1580
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 \
1581
+ KNAPSACK_PRO_CI_NODE_INDEX=0 \
1582
+ KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true \
1583
+ bundle exec rake "knapsack_pro:queue:rspec"
1584
+ ```
1507
1585
 
1508
1586
  If you were running your tests with `--order random` on your CI like this:
1509
1587
 
1510
- bundle exec rake "knapsack_pro:queue:rspec[--order random]"
1588
+ ```bash
1589
+ bundle exec rake "knapsack_pro:queue:rspec[--order random]"
1590
+ ```
1511
1591
 
1512
1592
  Then you can find the seed number visible in rspec output:
1513
1593
 
@@ -1516,15 +1596,17 @@ There are a few ways to reproduce tests executed on CI node in your development
1516
1596
 
1517
1597
  You can pass the seed in your local environment to reproduce the tests in the same order as they were executed on CI node:
1518
1598
 
1519
- RACK_ENV=test \
1520
- RAILS_ENV=test \
1521
- KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=token \
1522
- KNAPSACK_PRO_REPOSITORY_ADAPTER=git \
1523
- KNAPSACK_PRO_PROJECT_DIR=~/projects/rails-app \
1524
- KNAPSACK_PRO_CI_NODE_TOTAL=2 \
1525
- KNAPSACK_PRO_CI_NODE_INDEX=0 \
1526
- KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true \
1527
- bundle exec rake "knapsack_pro:queue:rspec[--seed 123]"
1599
+ ```bash
1600
+ RACK_ENV=test \
1601
+ RAILS_ENV=test \
1602
+ KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=token \
1603
+ KNAPSACK_PRO_REPOSITORY_ADAPTER=git \
1604
+ KNAPSACK_PRO_PROJECT_DIR=~/projects/rails-app \
1605
+ KNAPSACK_PRO_CI_NODE_TOTAL=2 \
1606
+ KNAPSACK_PRO_CI_NODE_INDEX=0 \
1607
+ KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true \
1608
+ bundle exec rake "knapsack_pro:queue:rspec[--seed 123]"
1609
+ ```
1528
1610
 
1529
1611
  #### What happens when Knapsack Pro API is not available/not reachable temporarily?
1530
1612
 
@@ -1588,14 +1670,16 @@ You need to create API token per each tag. In this example we need 3 different A
1588
1670
 
1589
1671
  You need to run below commands for each CI node.
1590
1672
 
1591
- # run only tests with tagA
1592
- KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=api_key_for_tagA bundle exec rake "knapsack_pro:rspec[--tag tagA]"
1673
+ ```bash
1674
+ # run only tests with tagA
1675
+ KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=api_key_for_tagA bundle exec rake "knapsack_pro:rspec[--tag tagA]"
1593
1676
 
1594
- # run only tests with tagB
1595
- KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=api_key_for_tagB bundle exec rake "knapsack_pro:rspec[--tag tagB]"
1677
+ # run only tests with tagB
1678
+ KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=api_key_for_tagB bundle exec rake "knapsack_pro:rspec[--tag tagB]"
1596
1679
 
1597
- # run other tests without tag A & B
1598
- KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=api_key_for_tests_without_tags_A_and_B bundle exec rake "knapsack_pro:rspec[--tag ~tagA --tag ~tagB]"
1680
+ # run other tests without tag A & B
1681
+ KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=api_key_for_tests_without_tags_A_and_B bundle exec rake "knapsack_pro:rspec[--tag ~tagA --tag ~tagB]"
1682
+ ```
1599
1683
 
1600
1684
  #### How to make knapsack_pro works for forked repositories of my project?
1601
1685
 
@@ -1611,7 +1695,7 @@ This way forked repositories have working test suite but without optimal test su
1611
1695
  Create the file `bin/knapsack_pro_rspec` with executable chmod in your main project repository.
1612
1696
  Below example is for rspec. You can change `$KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC` to `$KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER` if you use cucumber etc.
1613
1697
 
1614
- ```
1698
+ ```bash
1615
1699
  #!/bin/bash
1616
1700
  if [ "$KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC" = "" ]; then
1617
1701
  KNAPSACK_PRO_ENDPOINT=https://api-disabled-for-fork.knapsackpro.com \
@@ -1636,37 +1720,43 @@ Remember to follow other steps required for your CI provider.
1636
1720
  You can use junit formatter for rspec thanks to gem [rspec_junit_formatter](https://github.com/sj26/rspec_junit_formatter).
1637
1721
  Here you can find example how to generate `rspec.xml` file with junit format and at the same time show normal documentation format output for RSpec.
1638
1722
 
1639
- # Regular Mode
1640
- bundle exec rake "knapsack_pro:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec.xml]"
1723
+ ```bash
1724
+ # Regular Mode
1725
+ bundle exec rake "knapsack_pro:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec.xml]"
1726
+ ```
1641
1727
 
1642
1728
  ##### How to use junit formatter with knapsack_pro queue mode?
1643
1729
 
1644
1730
  You can use junit formatter for rspec thanks to gem [rspec_junit_formatter](https://github.com/sj26/rspec_junit_formatter).
1645
1731
 
1646
- # Queue Mode
1647
- bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec.xml]"
1732
+ ```bash
1733
+ # Queue Mode
1734
+ bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec.xml]"
1735
+ ```
1648
1736
 
1649
1737
  The xml report will contain all tests executed across intermediate test subset runs based on work queue. You need to add after subset queue hook to rename `rspec.xml` to `rspec_final_results.xml` thanks to that the final results file will contain only single xml tag with all tests executed on the CI node. This is related to the way how queue mode works. Detailed explanation is in the [issue](https://github.com/KnapsackPro/knapsack_pro-ruby/issues/40).
1650
1738
 
1651
- # spec_helper.rb or rails_helper.rb
1739
+ ```ruby
1740
+ # spec_helper.rb or rails_helper.rb
1652
1741
 
1653
- # TODO This must be the same path as value for rspec --out argument
1654
- # Note the path should not contain sign ~, for instance path ~/project/tmp/rspec.xml may not work. Please use full path instead.
1655
- TMP_RSPEC_XML_REPORT = 'tmp/rspec.xml'
1656
- # move results to FINAL_RSPEC_XML_REPORT so the results won't accumulate with duplicated xml tags in TMP_RSPEC_XML_REPORT
1657
- FINAL_RSPEC_XML_REPORT = 'tmp/rspec_final_results.xml'
1742
+ # TODO This must be the same path as value for rspec --out argument
1743
+ # Note the path should not contain sign ~, for instance path ~/project/tmp/rspec.xml may not work. Please use full path instead.
1744
+ TMP_RSPEC_XML_REPORT = 'tmp/rspec.xml'
1745
+ # move results to FINAL_RSPEC_XML_REPORT so the results won't accumulate with duplicated xml tags in TMP_RSPEC_XML_REPORT
1746
+ FINAL_RSPEC_XML_REPORT = 'tmp/rspec_final_results.xml'
1658
1747
 
1659
- KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id|
1660
- if File.exist?(TMP_RSPEC_XML_REPORT)
1661
- FileUtils.mv(TMP_RSPEC_XML_REPORT, FINAL_RSPEC_XML_REPORT)
1662
- end
1663
- end
1748
+ KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id|
1749
+ if File.exist?(TMP_RSPEC_XML_REPORT)
1750
+ FileUtils.mv(TMP_RSPEC_XML_REPORT, FINAL_RSPEC_XML_REPORT)
1751
+ end
1752
+ end
1753
+ ```
1664
1754
 
1665
1755
  ###### How to use junit formatter with knapsack_pro queue mode when CI nodes use common local drive?
1666
1756
 
1667
1757
  Note if you use a CI provider or your own CI solution that uses common local drive for all parallel CI nodes then above solution needs to be adjusted to produce report file with CI node index number in the file name to avoid file conflicts. Example file name with CI node index number: `tmp/rspec_final_results_N.xml`.
1668
1758
 
1669
- ```
1759
+ ```bash
1670
1760
  # Queue Mode
1671
1761
 
1672
1762
  # must be exported to read correctly the value in below knapsack_pro command
@@ -1678,7 +1768,7 @@ bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format Rspec
1678
1768
 
1679
1769
  In below code we use CI node index number in `TMP_RSPEC_XML_REPORT` and `FINAL_RSPEC_XML_REPORT`:
1680
1770
 
1681
- ```
1771
+ ```ruby
1682
1772
  # spec_helper.rb or rails_helper.rb
1683
1773
 
1684
1774
  # TODO This must be the same path as value for rspec --out argument
@@ -1699,6 +1789,67 @@ end
1699
1789
  The `tmp/rspec_final_results.xml` might be corrupted due syntax error in your test suite. First check if your test suite is green.
1700
1790
  Another reason might be that you did not configure the junit formatter as shown in the example for Queue Mode. Please check above 2 questions & answers explaing that.
1701
1791
 
1792
+ #### How to use JSON formatter for RSpec?
1793
+
1794
+ ##### How to use RSpec JSON formatter with knapsack_pro Queue Mode?
1795
+
1796
+ You need to specify `format` and `out` argument (it's important to provide both).
1797
+
1798
+ ```bash
1799
+ # Queue Mode
1800
+ bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format json --out tmp/rspec.json]"
1801
+ ```
1802
+
1803
+ The JSON report will contain all tests executed across intermediate test subset runs based on work queue. You need to add after subset queue hook to rename `rspec.json` to `rspec_final_results.json` thanks to that the final results file will contain valid json with all tests executed on the CI node. This is related to the way how Queue Mode works. Detailed explanation is in the [issue](https://github.com/KnapsackPro/knapsack_pro-ruby/issues/40).
1804
+
1805
+ ```ruby
1806
+ # spec_helper.rb or rails_helper.rb
1807
+
1808
+ # TODO This must be the same path as value for rspec --out argument
1809
+ # Note the path should not contain sign ~, for instance path ~/project/tmp/rspec.json may not work. Please use full path instead.
1810
+ TMP_RSPEC_JSON_REPORT = 'tmp/rspec.json'
1811
+ # move results to FINAL_RSPEC_JSON_REPORT so the results won't accumulate with duplicated JSON in TMP_RSPEC_JSON_REPORT
1812
+ FINAL_RSPEC_JSON_REPORT = 'tmp/rspec_final_results.json'
1813
+
1814
+ KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id|
1815
+ if File.exist?(TMP_RSPEC_JSON_REPORT)
1816
+ FileUtils.mv(TMP_RSPEC_JSON_REPORT, FINAL_RSPEC_JSON_REPORT)
1817
+ end
1818
+ end
1819
+ ```
1820
+
1821
+ ###### How to use RSpec JSON formatter with knapsack_pro Queue Mode when CI nodes use common local drive?
1822
+
1823
+ Note if you use a CI provider or your own CI solution that uses common local drive for all parallel CI nodes then above solution needs to be adjusted to produce report file with CI node index number in the file name to avoid file conflicts. Example file name with CI node index number: `tmp/rspec_final_results_N.json`.
1824
+
1825
+ ```
1826
+ # Queue Mode
1827
+
1828
+ # must be exported to read correctly the value in below knapsack_pro command
1829
+ export KNAPSACK_PRO_CI_NODE_INDEX=0
1830
+ # if your CI provider exposes CI node index under other environment variable name then you could use it instead
1831
+
1832
+ bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format json --out tmp/rspec_$KNAPSACK_PRO_CI_NODE_INDEX.json]"
1833
+ ```
1834
+
1835
+ In below code we use CI node index number in `TMP_RSPEC_JSON_REPORT` and `FINAL_RSPEC_JSON_REPORT`:
1836
+
1837
+ ```ruby
1838
+ # spec_helper.rb or rails_helper.rb
1839
+
1840
+ # TODO This must be the same path as value for rspec --out argument
1841
+ # Note the path should not contain sign ~, for instance path ~/project/tmp/rspec.json may not work. Please use full path instead.
1842
+ TMP_RSPEC_JSON_REPORT = "tmp/rspec_#{ENV['KNAPSACK_PRO_CI_NODE_INDEX']}.json"
1843
+ # move results to FINAL_RSPEC_JSON_REPORT so the results won't accumulate with duplicated JSON in TMP_RSPEC_JSON_REPORT
1844
+ FINAL_RSPEC_JSON_REPORT = "tmp/rspec_final_results_#{ENV['KNAPSACK_PRO_CI_NODE_INDEX']}.json"
1845
+
1846
+ KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id|
1847
+ if File.exist?(TMP_RSPEC_JSON_REPORT)
1848
+ FileUtils.mv(TMP_RSPEC_JSON_REPORT, FINAL_RSPEC_JSON_REPORT)
1849
+ end
1850
+ end
1851
+ ```
1852
+
1702
1853
  #### How many API keys I need?
1703
1854
 
1704
1855
  Basically you need as many API keys as you have steps in your build.
@@ -1791,7 +1942,7 @@ This means we would have 4 parallel knapack_pro commands in total across all CI
1791
1942
 
1792
1943
  Create in your project directory an executable file `bin/parallel_tests`:
1793
1944
 
1794
- ```
1945
+ ```bash
1795
1946
  #!/bin/bash
1796
1947
  # This file should be in bin/parallel_tests
1797
1948
 
@@ -1817,7 +1968,7 @@ Now you need to set parallel_tests command per CI node:
1817
1968
 
1818
1969
  * CI node 0 (first CI node):
1819
1970
 
1820
- ```
1971
+ ```bash
1821
1972
  export PARALLEL_TESTS_CONCURRENCY=2; # this must be export
1822
1973
  RAILS_ENV=test \
1823
1974
  KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=xxx \
@@ -1828,7 +1979,7 @@ Now you need to set parallel_tests command per CI node:
1828
1979
 
1829
1980
  * CI node 1 (second CI node):
1830
1981
 
1831
- ```
1982
+ ```bash
1832
1983
  export PARALLEL_TESTS_CONCURRENCY=2; # this must be export
1833
1984
  RAILS_ENV=test \
1834
1985
  KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=xxx \
@@ -1839,7 +1990,7 @@ Now you need to set parallel_tests command per CI node:
1839
1990
 
1840
1991
  Please note you need to update `$YOUR_CI_NODE_TOTAL` and `$YOUR_CI_NODE_INDEX` to the ENVs provided by your CI provider. For instance in case of CircleCI it would be `$CIRCLE_NODE_TOTAL` and `$CIRCLE_NODE_INDEX`. Below is an example for CircleCI configuration:
1841
1992
 
1842
- ```
1993
+ ```yaml
1843
1994
  # circle.yml for CircleCI 1.0
1844
1995
  # KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=xxx can be set in CircleCI ENV settings
1845
1996
  test:
@@ -1875,7 +2026,7 @@ You can use [only failures option in RSpec](https://relishapp.com/rspec/rspec-co
1875
2026
 
1876
2027
  Please add to your RSpec configuration:
1877
2028
 
1878
- ```
2029
+ ```ruby
1879
2030
  RSpec.configure do |c|
1880
2031
  c.example_status_persistence_file_path = "tmp/rspec_examples.txt"
1881
2032
  end
@@ -1883,7 +2034,7 @@ end
1883
2034
 
1884
2035
  Then you can execute rspec with only failed tests after main knapsack_pro command finish.
1885
2036
 
1886
- ```
2037
+ ```bash
1887
2038
  # Run knapack_pro in Queue Mode and it will save failed tests in tmp/rspec_examples.txt
1888
2039
  bundle exec rake knapsack_pro:queue:rspec
1889
2040
 
@@ -1956,7 +2107,7 @@ Run all specs from multiple directories except `spec/features` directory which i
1956
2107
  If you would like to run additional directory please add it after comma in `KNAPSACK_PRO_TEST_FILE_PATTERN`.
1957
2108
  Ensure the list of directories match your spec directory structure.
1958
2109
 
1959
- ```
2110
+ ```bash
1960
2111
  KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=$API_TOKEN_FOR_NON_FEATURE_TESTS \
1961
2112
  KNAPSACK_PRO_TEST_DIR=spec \
1962
2113
  KNAPSACK_PRO_TEST_FILE_PATTERN="{spec/*_spec.rb,spec/controllers/**/*_spec.rb,spec/mailers/**/*_spec.rb,spec/models/**/*_spec.rb,spec/presenters/**/*_spec.rb,spec/requests/**/*_spec.rb,spec/routing/**/*_spec.rb,spec/services/**/*_spec.rb,spec/workers/**/*_spec.rb,spec/jobs/**/*_spec.rb}" \
@@ -1965,7 +2116,7 @@ bundle exec rake knapsack_pro:queue:rspec
1965
2116
 
1966
2117
  When you would like to run tests only from `spec/features` directory then run:
1967
2118
 
1968
- ```
2119
+ ```bash
1969
2120
  KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC=$API_TOKEN_FOR_FEATURE_TESTS \
1970
2121
  KNAPSACK_PRO_TEST_DIR=spec \
1971
2122
  KNAPSACK_PRO_TEST_FILE_PATTERN="spec/features/**{,/*/**}/*_spec.rb" \
@@ -1978,14 +2129,14 @@ You can also learn [how to use exclude pattern](#how-to-exclude-tests-from-runni
1978
2129
 
1979
2130
  For instance you would like to run all tests except tests in `features` directory then you could do:
1980
2131
 
1981
- ```
2132
+ ```bash
1982
2133
  KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN="spec/features/**{,/*/**}/*_spec.rb" \
1983
2134
  bundle exec rake knapsack_pro:queue:rspec
1984
2135
  ```
1985
2136
 
1986
2137
  You can define at the same time the pattern for tests you would like to run and the exclude pattern. For instance run all controller tests except admin controller tests.
1987
2138
 
1988
- ```
2139
+ ```bash
1989
2140
  KNAPSACK_PRO_TEST_FILE_PATTERN="spec/controllers/**{,/*/**}/*_spec.rb" \
1990
2141
  KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN="spec/controllers/admin/**{,/*/**}/*_spec.rb" \
1991
2142
  bundle exec rake knapsack_pro:queue:rspec
@@ -2021,7 +2172,7 @@ or preview the [ENV variables that knapack_pro can read](https://github.com/Knap
2021
2172
 
2022
2173
  If you would like to make [simplecov](https://github.com/colszowka/simplecov) gem work with knapack_pro Queue Mode to correctly track code coverage for parallel CI nodes please do:
2023
2174
 
2024
- ```
2175
+ ```ruby
2025
2176
  # spec_helper.rb or rails_helper.rb
2026
2177
  require 'knapsack_pro'
2027
2178
 
@@ -117,7 +117,7 @@ module KnapsackPro
117
117
 
118
118
  case mode
119
119
  when :development
120
- 'http://api.knapsackpro.dev:3000'
120
+ 'http://api.knapsackpro.test:3000'
121
121
  when :test
122
122
  'https://api-staging.knapsackpro.com'
123
123
  when :production
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '1.3.0'
2
+ VERSION = '1.4.0'
3
3
  end
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://api.knapsackpro.dev:3000/v1/build_distributions/subset
5
+ uri: http://api.knapsackpro.test:3000/v1/build_distributions/subset
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"commit_hash":"abcdefg","branch":"master","node_total":"2","node_index":"1","test_files":[{"path":"a_spec.rb"},{"path":"b_spec.rb"}],"test_suite_token":"fake"}'
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://api.knapsackpro.dev:3000/v1/build_distributions/subset
5
+ uri: http://api.knapsackpro.test:3000/v1/build_distributions/subset
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"commit_hash":"abcdefg","branch":"master","node_total":"2","node_index":"1","test_files":[{"path":"a_spec.rb"},{"path":"b_spec.rb"}],"test_suite_token":"3fa64859337f6e56409d49f865d13fd7"}'
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://api.knapsackpro.dev:3000/v1/build_subsets
5
+ uri: http://api.knapsackpro.test:3000/v1/build_subsets
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"commit_hash":"abcdefg","branch":"master","node_total":"2","node_index":"1","test_files":[{"path":"a_spec.rb","time_execution":1.2},{"path":"b_spec.rb","time_execution":0.3}],"test_suite_token":"fake"}'
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: http://api.knapsackpro.dev:3000/v1/build_subsets
5
+ uri: http://api.knapsackpro.test:3000/v1/build_subsets
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: '{"commit_hash":"abcdefg","branch":"master","node_total":"2","node_index":"1","test_files":[{"path":"a_spec.rb","time_execution":1.2},{"path":"b_spec.rb","time_execution":0.3}],"test_suite_token":"3fa64859337f6e56409d49f865d13fd7"}'
@@ -1,6 +1,6 @@
1
1
  describe 'Request API /v1/build_distributions/subset' do
2
- let(:valid_endpoint) { 'http://api.knapsackpro.dev:3000' }
3
- let(:invalid_endpoint) { 'http://api.fake-knapsackpro.dev:3000' }
2
+ let(:valid_endpoint) { 'http://api.knapsackpro.test:3000' }
3
+ let(:invalid_endpoint) { 'http://api.fake-knapsackpro.test:3000' }
4
4
  let(:valid_test_suite_token) { '3fa64859337f6e56409d49f865d13fd7' }
5
5
  let(:invalid_test_suite_token) { 'fake' }
6
6
 
@@ -1,6 +1,6 @@
1
1
  describe 'Request API /v1/build_subsets' do
2
- let(:valid_endpoint) { 'http://api.knapsackpro.dev:3000' }
3
- let(:invalid_endpoint) { 'http://api.fake-knapsackpro.dev:3000' }
2
+ let(:valid_endpoint) { 'http://api.knapsackpro.test:3000' }
3
+ let(:invalid_endpoint) { 'http://api.fake-knapsackpro.test:3000' }
4
4
  let(:valid_test_suite_token) { '3fa64859337f6e56409d49f865d13fd7' }
5
5
  let(:invalid_test_suite_token) { 'fake' }
6
6
 
@@ -13,7 +13,7 @@ describe KnapsackPro::Client::Connection do
13
13
 
14
14
  before do
15
15
  stub_const('ENV', {
16
- 'KNAPSACK_PRO_ENDPOINT' => 'http://api.knapsackpro.dev:3000',
16
+ 'KNAPSACK_PRO_ENDPOINT' => 'http://api.knapsackpro.test:3000',
17
17
  'KNAPSACK_PRO_TEST_SUITE_TOKEN' => '3fa64859337f6e56409d49f865d13fd7',
18
18
  })
19
19
  end
@@ -27,7 +27,7 @@ describe KnapsackPro::Client::Connection do
27
27
  before do
28
28
  http = instance_double(Net::HTTP)
29
29
 
30
- expect(Net::HTTP).to receive(:new).with('api.knapsackpro.dev', 3000).and_return(http)
30
+ expect(Net::HTTP).to receive(:new).with('api.knapsackpro.test', 3000).and_return(http)
31
31
 
32
32
  expect(http).to receive(:use_ssl=).with(false)
33
33
  expect(http).to receive(:open_timeout=).with(15)
@@ -430,7 +430,7 @@ describe KnapsackPro::Config::Env do
430
430
 
431
431
  context 'when development mode' do
432
432
  before { stub_const("ENV", { 'KNAPSACK_PRO_MODE' => 'development' }) }
433
- it { should eq 'http://api.knapsackpro.dev:3000' }
433
+ it { should eq 'http://api.knapsackpro.test:3000' }
434
434
  end
435
435
 
436
436
  context 'when test mode' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-26 00:00:00.000000000 Z
11
+ date: 2019-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -396,8 +396,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
396
396
  - !ruby/object:Gem::Version
397
397
  version: '0'
398
398
  requirements: []
399
- rubyforge_project:
400
- rubygems_version: 2.7.8
399
+ rubygems_version: 3.0.1
401
400
  signing_key:
402
401
  specification_version: 4
403
402
  summary: Knapsack Pro splits tests across CI nodes and makes sure that tests will