From 3f84fd8c999a8be1d66240dc3c8edf316e37b59e Mon Sep 17 00:00:00 2001 From: Eric Mueller Date: Wed, 14 Jun 2023 17:45:20 -0400 Subject: [PATCH 1/3] red spec checking the logging of nil command --- spec/quiet_quality/executors/pipeline_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/quiet_quality/executors/pipeline_spec.rb b/spec/quiet_quality/executors/pipeline_spec.rb index b18b4d9..5b7c17b 100644 --- a/spec/quiet_quality/executors/pipeline_spec.rb +++ b/spec/quiet_quality/executors/pipeline_spec.rb @@ -61,6 +61,16 @@ end end + context "when the runner is skipping" do + before { allow(runner).to receive(:command).and_return(nil) } + + it "logs the empty command" do + outcome + expect_info("Runner rspec command: (skipped)") + expect_debug("Full command for rspec", data: nil) + end + end + shared_examples "it matches the runner outcome, failure status aside" do it "matches the runner outcome, aside from the failure status" do expect(outcome.output).to eq(runner_outcome.output) From 30ce7c2208917dda58c38054730f710a8a83e48d Mon Sep 17 00:00:00 2001 From: Eric Mueller Date: Wed, 14 Jun 2023 17:45:45 -0400 Subject: [PATCH 2/3] display (skipped) when the command is nil --- lib/quiet_quality/executors/pipeline.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/quiet_quality/executors/pipeline.rb b/lib/quiet_quality/executors/pipeline.rb index 4209c2d..2e1620e 100644 --- a/lib/quiet_quality/executors/pipeline.rb +++ b/lib/quiet_quality/executors/pipeline.rb @@ -54,7 +54,8 @@ def runner end def log_runner(r) - info("Runner #{r.tool_name} command: `#{r.command.join(" ")}`") + command_string = r.command ? "`#{r.command.join(" ")}`" : "(skipped)" + info("Runner #{r.tool_name} command: #{command_string}") debug("Full command for #{r.tool_name}", data: r.command) end From 23e7a5a54711f1cbef78aafa04ce62eed06d7efa Mon Sep 17 00:00:00 2001 From: Eric Mueller Date: Wed, 14 Jun 2023 17:49:01 -0400 Subject: [PATCH 3/3] bump to 1.3.1 and update the changelog --- CHANGELOG.md | 5 +++++ lib/quiet_quality/version.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5409903..11d4b37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Release 1.3.1 + +* Fix a bug around the logging of nil commands when runners are skipped (#104 + resolves #103) + ## Release 1.3.0 * Support (and enable by default) colorizing the console stderr output from diff --git a/lib/quiet_quality/version.rb b/lib/quiet_quality/version.rb index 13dce33..a569854 100644 --- a/lib/quiet_quality/version.rb +++ b/lib/quiet_quality/version.rb @@ -1,3 +1,3 @@ module QuietQuality - VERSION = "1.3.0" + VERSION = "1.3.1" end