Skip to content

Commit

Permalink
#311 more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Suban05 committed Aug 24, 2024
1 parent 5fc85e5 commit bd6873c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion judges/github-events/scan-many-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ options:
repositories: yegor256/judges,yegor256/factbase,zerocracy/baza
runs: 5
expected:
- /fb[count(f)=6]
- /fb[count(f)=7]
14 changes: 12 additions & 2 deletions test/judges/test-github-events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -917,8 +917,18 @@ def test_pull_request_event_with_comments

def test_count_numbers_of_workflow_builds
fb = Factbase.new
load_it('github-events', fb, Judges::Options.new({ 'repositories' => 'zerocracy/baza', 'testing' => true }))
f = fb.query('(eq what "pull-was-merged")').each.to_a.first
repo = 'zerocracy/baza'
load_it('github-events', fb, Judges::Options.new({ 'repositories' => repo, 'testing' => true }))
f = fb.query("(and (eq what \"pull-was-merged\") (eq branch \"#{repo}\"))").each.to_a.first
assert_equal(4, f.succeeded_builds)
assert_equal(2, f.failed_builds)
end

def test_count_numbers_of_workflow_builds_only_from_github
fb = Factbase.new
repo = 'zerocracy/judges-action'
load_it('github-events', fb, Judges::Options.new({ 'repositories' => repo, 'testing' => true }))
f = fb.query("(and (eq what \"pull-was-merged\") (eq branch \"#{repo}\"))").each.to_a.first
assert_equal(3, f.succeeded_builds)
assert_equal(2, f.failed_builds)
end
Expand Down

0 comments on commit bd6873c

Please sign in to comment.