Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup updater specs output #5666

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions updater/spec/dependabot/file_fetcher_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
)
expect(api_client).to receive(:mark_job_as_processed)

perform_job
expect { perform_job }.to output(/Error during file fetching; aborting/).to_stdout_from_any_process
end
end

Expand All @@ -94,7 +94,7 @@
)
expect(api_client).to receive(:mark_job_as_processed)

perform_job
expect { perform_job }.to output(/Error during file fetching; aborting/).to_stdout_from_any_process
end
end

Expand Down Expand Up @@ -123,7 +123,7 @@
)
expect(api_client).to receive(:mark_job_as_processed)

perform_job
expect { perform_job }.to output(/Repository is rate limited, attempting to retry/).to_stdout_from_any_process
end
end

Expand Down Expand Up @@ -181,7 +181,7 @@
end
expect(api_client).to receive(:mark_job_as_processed)

perform_job
expect { perform_job }.to output(/Something went wrong/).to_stdout_from_any_process

expect(Dir.exist?(Dependabot::Environment.repo_contents_path)).to be_truthy
expect(Dir.empty?(Dependabot::Environment.repo_contents_path)).to be_truthy
Expand Down
9 changes: 5 additions & 4 deletions updater/spec/dependabot/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,18 @@
expect(api_client).to receive(:record_update_job_error).
with(job_id, { error_type: "unknown_error", error_details: nil })

end_to_end_job.run
expect { end_to_end_job.run }.to output(/oh no!/).to_stdout_from_any_process
end

it "indicates there was an error in the summary" do
expect(Dependabot.logger).not_to receive(:info).with(/Changes to Dependabot Pull Requests/)
expect(Dependabot.logger).to receive(:info).with(/Dependabot encountered '1' error/)

end_to_end_job.run
expect { end_to_end_job.run }.to output(/oh no!/).to_stdout_from_any_process
end

it "does not raise an exception" do
expect { end_to_end_job.run }.not_to raise_error
expect { end_to_end_job.run }.to output(/oh no!/).to_stdout_from_any_process
end

context "when GITHUB_ACTIONS is set" do
Expand All @@ -195,7 +195,8 @@
end

it "raises an exception" do
expect { end_to_end_job.run }.to raise_error(Dependabot::RunFailure)
expect { end_to_end_job.run }.to raise_error(Dependabot::RunFailure).
and output(/oh no!/).to_stdout_from_any_process
end
end
end
Expand Down