Merge pull request #15619 from Bo98/artifact-test-fix

test/utils/github_spec: fix artifact URL test
This commit is contained in:
Bo Anderson 2023-07-03 04:16:41 +01:00 committed by GitHub
commit f40b0f9f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,16 +57,18 @@ describe GitHub do
it "fails to find artifacts that don't exist" do it "fails to find artifacts that don't exist" do
expect do expect do
described_class.get_artifact_url( described_class.get_artifact_url(
described_class.get_workflow_run("Homebrew", "homebrew-core", "79751", artifact_name: "false_bottles"), described_class.get_workflow_run("Homebrew", "homebrew-core", "135608",
workflow_id: "triage.yml", artifact_name: "false_artifact"),
) )
end.to raise_error(/No artifact .+ was found/) end.to raise_error(/No artifact .+ was found/)
end end
it "gets an artifact link" do it "gets an artifact link" do
url = described_class.get_artifact_url( url = described_class.get_artifact_url(
described_class.get_workflow_run("Homebrew", "homebrew-core", "79751", artifact_name: "bottles"), described_class.get_workflow_run("Homebrew", "homebrew-core", "135608",
workflow_id: "triage.yml", artifact_name: "event_payload"),
) )
expect(url).to eq("https://api.github.com/repos/Homebrew/homebrew-core/actions/artifacts/70494047/zip") expect(url).to eq("https://api.github.com/repos/Homebrew/homebrew-core/actions/artifacts/781984175/zip")
end end
end end