Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kostyaplis committed Apr 1, 2020
1 parent 2951d9f commit 0be93f4
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test_danger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ on:
push:
branches:
- master
pull_request:

jobs:
danger:
name: Post Test results
Expand Down Expand Up @@ -31,6 +33,6 @@ jobs:
bundle install --jobs 4 --retry 3
- name: Run danger
env:
GITHUB_TOKEN: test #${{ secrets.PERX_API_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}
run: |
bundle exec danger
20 changes: 15 additions & 5 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@ result_files = Dir.glob("rspec-junit/rspec-*")
junit.parse_files result_files
junit.show_skipped_tests = true
# junit.headers = %i(file name message)
junit.report
all_test = junit.tests.map(&:attributes)
slowest_test = sort_by { |attributes| attributes[:time].to_f }.last
message "#{slowest_test[:time]} took #{slowest_test[:time]} seconds"
puts junit.failures
# junit.report
# all_test = junit.tests.map(&:attributes)
# slowest_test = all_test.sort_by { |attributes| attributes[:time].to_f }.last
# message "#{slowest_test[:name]} took #{slowest_test[:time]} seconds"

message junit.failures.to_s

junit.failures.each do |failure|
message failure.to_s
# failure.map(&:attributes)
# fail("")
node = failure.nodes.first
fail(node.to_s)
end

19 changes: 19 additions & 0 deletions rspec-junit/rspec-4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,25 @@
<testcase classname="spec.requests.dash.v4.voucher_code_inventory_batches_spec" name="Voucher code inventory batches API Dash V4 #download_voucher_codes with filters returns filtered codes" file="./spec/requests/dash/v4/voucher_code_inventory_batches_spec.rb" time="0.407172"></testcase>
<testcase classname="spec.requests.og_spec" name="OgController redirects to og_document_url" file="./spec/requests/og_spec.rb" time="0.046504"><failure message="No route matches [GET] &quot;/og&quot;" type="ActionController::RoutingError">Failure/Error: @app.call(env)

ActionController::RoutingError:
No route matches [GET] &quot;/og&quot;
/usr/local/bundle/gems/lograge-0.11.2/lib/lograge/rails_ext/rack/logger.rb:15:in `call_app&apos;
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/rack/logger.rb:26:in `block in call&apos;
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/rack/logger.rb:26:in `call&apos;
/usr/local/bundle/gems/request_store-1.5.0/lib/request_store/middleware.rb:19:in `call&apos;
/usr/local/bundle/gems/rack-2.2.2/lib/rack/runtime.rb:22:in `call&apos;
./app/middleware/invalid_params_interceptor.rb:20:in `call&apos;
/usr/local/bundle/gems/rack-2.2.2/lib/rack/sendfile.rb:110:in `call&apos;
/usr/local/bundle/gems/rack-cors-1.0.6/lib/rack/cors.rb:98:in `call&apos;
/usr/local/bundle/gems/invalid_utf8_rejector-0.0.4/lib/invalid_utf8_rejector/middleware.rb:11:in `call&apos;
/usr/local/bundle/gems/sentry-raven-2.13.0/lib/raven/integrations/rack.rb:51:in `call&apos;
/usr/local/bundle/gems/railties-6.0.2.1/lib/rails/engine.rb:526:in `call&apos;
/usr/local/bundle/gems/rack-test-1.1.0/lib/rack/mock_session.rb:29:in `request&apos;
/usr/local/bundle/gems/rack-test-1.1.0/lib/rack/test.rb:266:in `process_request&apos;
/usr/local/bundle/gems/rack-test-1.1.0/lib/rack/test.rb:119:in `request&apos;
./spec/requests/og_spec.rb:10:in `block (2 levels) in &lt;main&gt;&apos;</failure></testcase>
<testcase classname="spec.requests.og_spec" name="OgController second redirects to og_document_url" file="./spec/requests/og_spec.rb" time="0.046504"><failure message="No route matches [GET] &quot;/og&quot;" type="ActionController::RoutingError">Failure/Error: @app.call(env)

ActionController::RoutingError:
No route matches [GET] &quot;/og&quot;
/usr/local/bundle/gems/lograge-0.11.2/lib/lograge/rails_ext/rack/logger.rb:15:in `call_app&apos;
Expand Down

0 comments on commit 0be93f4

Please sign in to comment.