-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing class name Signed-off-by: Rodrigo Nardi <[email protected]>
- Loading branch information
1 parent
93b6f00
commit bbbf22f
Showing
3 changed files
with
42 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# SPDX-License-Identifier: BSD-2-Clause | ||
# | ||
# skip_old_tests.rb | ||
# Part of NetDEF CI System | ||
# | ||
# Copyright (c) 2024 by | ||
# Network Device Education Foundation, Inc. ("NetDEF") | ||
# | ||
# frozen_string_literal: true | ||
|
||
module Github | ||
module Build | ||
class SkipOldTests | ||
def initialize(check_suite) | ||
@check_suite = check_suite | ||
@github = Github::Check.new(@check_suite) | ||
@stages = StageConfiguration.all.map(&:github_check_run_name) | ||
@logger = GithubLogger.instance.create('github_skip_old_tests.log', Logger::INFO) | ||
end | ||
|
||
def skip_old_tests | ||
@github | ||
.check_runs_for_ref(@check_suite.pull_request.repository, @check_suite.commit_sha_ref)[:check_runs] | ||
&.each { |check_run| skipping_old_test(check_run) } | ||
end | ||
|
||
private | ||
|
||
def skipping_old_test(check_run) | ||
return if @stages.include?(check_run[:name]) or check_run[:app][:name] != 'NetDEF CI Hook' | ||
|
||
@logger.info("Skipping old test suite: #{check_run[:name]}") | ||
|
||
message = 'Old test suite, skipping...' | ||
@github.create(check_run[:name]) | ||
@github.skipped(check_run[:id], { title: "#{check_run[:name]} summary", summary: message }) | ||
end | ||
end | ||
end | ||
end | ||
|
||
Check warning on line 41 in lib/github/build/skip_old_tests.rb GitHub Actions / Rubocop
|