Merge pull request #18569 from Homebrew/artifact-test-fix

test/utils/github_spec: fix artifact URL test
This commit is contained in:
Ruoyu Zhong 2024-10-15 03:17:10 +08:00 committed by GitHub
commit aba44a4b7a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,7 +58,7 @@ RSpec.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_urls( described_class.get_artifact_urls(
described_class.get_workflow_run("Homebrew", "homebrew-core", "135608", described_class.get_workflow_run("Homebrew", "homebrew-core", "191680",
workflow_id: "triage.yml", artifact_pattern: "false_artifact"), workflow_id: "triage.yml", artifact_pattern: "false_artifact"),
) )
end.to raise_error(/No artifacts with the pattern .+ were found/) end.to raise_error(/No artifacts with the pattern .+ were found/)
@ -66,10 +66,10 @@ RSpec.describe GitHub do
it "gets artifact URLs" do it "gets artifact URLs" do
urls = described_class.get_artifact_urls( urls = described_class.get_artifact_urls(
described_class.get_workflow_run("Homebrew", "homebrew-core", "135608", described_class.get_workflow_run("Homebrew", "homebrew-core", "191680",
workflow_id: "triage.yml", artifact_pattern: "event_payload"), workflow_id: "triage.yml", artifact_pattern: "event_payload"),
) )
expect(urls).to eq(["https://api.github.com/repos/Homebrew/homebrew-core/actions/artifacts/781984175/zip"]) expect(urls).to eq(["https://api.github.com/repos/Homebrew/homebrew-core/actions/artifacts/1969725476/zip"])
end end
it "supports pattern matching" do it "supports pattern matching" do