From c14acfb35481307a478a7c230d0fbdde015e12b5 Mon Sep 17 00:00:00 2001 From: safa Date: Wed, 3 Jan 2024 14:50:14 +0100 Subject: [PATCH] wip --- .github/workflows/ci.yml | 10 ++++++++++ lib/failing_spec_detector/combiner.rb | 9 +++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b1575d..20f1751 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,4 +56,14 @@ jobs: name: Exceptions - name: Run print_log task run: bundle exec rake failing_specs_detector:print_log + - name: Get results + id: results + run: | + { + echo 'LOG<> $GITHUB_OUTPUT + - name: Print result + run: echo ${{ steps.results.outputs.LOG }} diff --git a/lib/failing_spec_detector/combiner.rb b/lib/failing_spec_detector/combiner.rb index 0a1d575..fd5d5cd 100644 --- a/lib/failing_spec_detector/combiner.rb +++ b/lib/failing_spec_detector/combiner.rb @@ -6,19 +6,20 @@ class Combiner def initialize(exceptions, failures) @exceptions = exceptions @failures = failures + @filename = 'failing_specs_detector.txt' end def combine - puts "Failing specs detector:\n\n\n" + File.write(@filename, "Failing specs detector:\n\n\n") @exceptions.uniq.each do |exception| - puts "#{exception}:\n\n" + File.write(@filename, "#{exception}:\n\n", mode: 'a') related_examples = @failures.select { |failure| failure.exception == exception } next if related_examples.empty? related_examples.each do |failure| - puts "#{failure.backtrace}:\n" + File.write(@filename, "#{failure.backtrace}:\n", mode: 'a') end - puts "\n\n\n" + File.write(@filename, "\n\n\n", mode: 'a') end end end