Skip to content

Commit

Permalink
Use knapsack_pro 1.12.0 and add example of Queue Mode in Cucumber
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturT committed Jun 7, 2019
1 parent cd27392 commit a2158ef
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
- run: mkdir -p tmp/test-reports/rspec/regular_mode/
- run: mkdir -p tmp/test-reports/rspec/queue_mode/
- run: mkdir -p tmp/test-reports/cucumber/regular_mode/
- run: mkdir -p tmp/test-reports/cucumber/queue_mode/

- run:
name: Install Code Climate Test Reporter
Expand Down Expand Up @@ -124,6 +125,11 @@ jobs:

- run: bundle exec rake "knapsack_pro:cucumber[--format junit --out tmp/test-reports/cucumber/regular_mode]"

# Queue Mode in Cucumber
- run: KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER=$KNAPSACK_PRO_QUEUE_TEST_SUITE_TOKEN_CUCUMBER bundle exec rake knapsack_pro:cucumber

- run: KNAPSACK_PRO_FIXED_QUEUE_SPLIT=true KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER=$KNAPSACK_PRO_QUEUE_TEST_SUITE_TOKEN_CUCUMBER bundle exec rake "knapsack_pro:queue:cucumber[--format junit --out tmp/test-reports/cucumber/queue_mode/]"

- run: bundle exec rake knapsack_pro:minitest[--verbose]

- run: KNAPSACK_PRO_TEST_DIR=test-unit KNAPSACK_PRO_TEST_FILE_PATTERN="test-unit/**{,/*/**}/*_test.rb" bundle exec rake "knapsack_pro:test_unit[--verbose]"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../knapsack_pro-ruby
specs:
knapsack_pro (1.11.0)
knapsack_pro (1.12.0)
rake

GEM
Expand Down
6 changes: 6 additions & 0 deletions bin/knapsack_pro_all.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@
./bin/knapsack_pro_cucumber_junit 0 2
./bin/knapsack_pro_cucumber_junit 1 2
./bin/knapsack_pro_queue_cucumber 0 2
./bin/knapsack_pro_queue_cucumber 1 2
./bin/knapsack_pro_queue_cucumber_junit 0 2
./bin/knapsack_pro_queue_cucumber_junit 1 2
# Minitest
./bin/knapsack_pro_minitest 0 2
./bin/knapsack_pro_minitest 1 2
Expand Down
9 changes: 9 additions & 0 deletions bin/knapsack_pro_queue_cucumber
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

KNAPSACK_PRO_ENDPOINT=http:https://api.knapsackpro.test:3000 \
KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER=79e4ffe972af086dfb70b90810622290 \
KNAPSACK_PRO_REPOSITORY_ADAPTER=git \
KNAPSACK_PRO_PROJECT_DIR=~/Documents/github/knapsack-pro/rails-app-with-knapsack_pro \
KNAPSACK_PRO_CI_NODE_TOTAL=${2:-2} \
KNAPSACK_PRO_CI_NODE_INDEX=${1:-0} \
bundle exec rake knapsack_pro:queue:cucumber
9 changes: 9 additions & 0 deletions bin/knapsack_pro_queue_cucumber_junit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

KNAPSACK_PRO_ENDPOINT=http:https://api.knapsackpro.test:3000 \
KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER=79e4ffe972af086dfb70b90810622290 \
KNAPSACK_PRO_REPOSITORY_ADAPTER=git \
KNAPSACK_PRO_PROJECT_DIR=~/Documents/github/knapsack-pro/rails-app-with-knapsack_pro \
KNAPSACK_PRO_CI_NODE_TOTAL=${2:-2} \
KNAPSACK_PRO_CI_NODE_INDEX=${1:-0} \
bundle exec rake "knapsack_pro:queue:cucumber[--format junit --out tmp/test-reports/cucumber/queue_mode/ --retry 5 --no-strict-flaky]"
17 changes: 17 additions & 0 deletions features/support/knapsack_pro.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
require 'knapsack_pro'

# CUSTOM_CONFIG_GOES_HERE
KnapsackPro::Hooks::Queue.before_queue do |queue_id|
print '-'*10
print 'Before Queue Hook - run before test suite'
print '-'*10
end

KnapsackPro::Hooks::Queue.after_subset_queue do |queue_id, subset_queue_id|
print '-'*10
print 'After Subset Queue Hook - run after subset of test suite'
print '-'*10
end

KnapsackPro::Hooks::Queue.after_queue do |queue_id|
print '-'*10
print 'After Queue Hook - run after test suite'
print '-'*10
end

KnapsackPro::Adapters::CucumberAdapter.bind

0 comments on commit a2158ef

Please sign in to comment.