-
-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try reenabling all specs on macOS in GitHub Actions
* The main cause of timeouts seems compile_extension() being too slow on macOS GitHub Actions.
- Loading branch information
Showing
5 changed files
with
91 additions
and
101 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
require_relative '../spec_helper' | ||
|
||
guard_not -> { platform_is :darwin and ENV['GITHUB_ACTIONS'] } do # frequent timeout/hang on macOS in GitHub Actions | ||
require 'rubygems' | ||
require 'rubygems/user_interaction' | ||
require 'rubygems' | ||
require 'rubygems/user_interaction' | ||
|
||
describe "CVE-2019-8321 is resisted by" do | ||
it "sanitising verbose messages" do | ||
ui = Class.new { | ||
include Gem::UserInteraction | ||
}.new | ||
ui.should_receive(:say).with(".]2;nyan.") | ||
verbose_before = Gem.configuration.verbose | ||
begin | ||
Gem.configuration.verbose = :really_verbose | ||
ui.verbose("\e]2;nyan\a") | ||
ensure | ||
Gem.configuration.verbose = verbose_before | ||
end | ||
describe "CVE-2019-8321 is resisted by" do | ||
it "sanitising verbose messages" do | ||
ui = Class.new { | ||
include Gem::UserInteraction | ||
}.new | ||
ui.should_receive(:say).with(".]2;nyan.") | ||
verbose_before = Gem.configuration.verbose | ||
begin | ||
Gem.configuration.verbose = :really_verbose | ||
ui.verbose("\e]2;nyan\a") | ||
ensure | ||
Gem.configuration.verbose = verbose_before | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -1,23 +1,21 @@ | ||
require_relative '../spec_helper' | ||
|
||
guard_not -> { platform_is :darwin and ENV['GITHUB_ACTIONS'] } do # frequent timeout/hang on macOS in GitHub Actions | ||
require 'yaml' | ||
require 'rubygems' | ||
require 'rubygems/safe_yaml' | ||
require 'rubygems/commands/owner_command' | ||
require 'yaml' | ||
require 'rubygems' | ||
require 'rubygems/safe_yaml' | ||
require 'rubygems/commands/owner_command' | ||
|
||
describe "CVE-2019-8322 is resisted by" do | ||
it "sanitising owner names" do | ||
command = Gem::Commands::OwnerCommand.new | ||
def command.rubygems_api_request(*args) | ||
Struct.new(:body).new("---\n- email: \"\e]2;nyan\a\"\n handle: handle\n id: id\n") | ||
end | ||
def command.with_response(response) | ||
yield response | ||
end | ||
command.should_receive(:say).with("Owners for gem: name") | ||
command.should_receive(:say).with("- .]2;nyan.") | ||
command.show_owners "name" | ||
describe "CVE-2019-8322 is resisted by" do | ||
it "sanitising owner names" do | ||
command = Gem::Commands::OwnerCommand.new | ||
def command.rubygems_api_request(*args) | ||
Struct.new(:body).new("---\n- email: \"\e]2;nyan\a\"\n handle: handle\n id: id\n") | ||
end | ||
def command.with_response(response) | ||
yield response | ||
end | ||
command.should_receive(:say).with("Owners for gem: name") | ||
command.should_receive(:say).with("- .]2;nyan.") | ||
command.show_owners "name" | ||
end | ||
end |
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 |
---|---|---|
@@ -1,38 +1,36 @@ | ||
require_relative '../spec_helper' | ||
|
||
guard_not -> { platform_is :darwin and ENV['GITHUB_ACTIONS'] } do # frequent timeout/hang on macOS in GitHub Actions | ||
require 'optparse' | ||
require 'optparse' | ||
|
||
require 'rubygems' | ||
require 'rubygems/gemcutter_utilities' | ||
require 'rubygems' | ||
require 'rubygems/gemcutter_utilities' | ||
|
||
describe "CVE-2019-8323 is resisted by" do | ||
describe "sanitising the body" do | ||
it "for success codes" do | ||
cutter = Class.new { | ||
include Gem::GemcutterUtilities | ||
}.new | ||
response = Net::HTTPSuccess.new(nil, nil, nil) | ||
def response.body | ||
"\e]2;nyan\a" | ||
end | ||
cutter.should_receive(:say).with(".]2;nyan.") | ||
cutter.with_response response | ||
describe "CVE-2019-8323 is resisted by" do | ||
describe "sanitising the body" do | ||
it "for success codes" do | ||
cutter = Class.new { | ||
include Gem::GemcutterUtilities | ||
}.new | ||
response = Net::HTTPSuccess.new(nil, nil, nil) | ||
def response.body | ||
"\e]2;nyan\a" | ||
end | ||
cutter.should_receive(:say).with(".]2;nyan.") | ||
cutter.with_response response | ||
end | ||
|
||
it "for error codes" do | ||
cutter = Class.new { | ||
include Gem::GemcutterUtilities | ||
}.new | ||
def cutter.terminate_interaction(n) | ||
end | ||
response = Net::HTTPNotFound.new(nil, nil, nil) | ||
def response.body | ||
"\e]2;nyan\a" | ||
end | ||
cutter.should_receive(:say).with(".]2;nyan.") | ||
cutter.with_response response | ||
it "for error codes" do | ||
cutter = Class.new { | ||
include Gem::GemcutterUtilities | ||
}.new | ||
def cutter.terminate_interaction(n) | ||
end | ||
response = Net::HTTPNotFound.new(nil, nil, nil) | ||
def response.body | ||
"\e]2;nyan\a" | ||
end | ||
cutter.should_receive(:say).with(".]2;nyan.") | ||
cutter.with_response response | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -1,38 +1,36 @@ | ||
require_relative '../spec_helper' | ||
|
||
guard_not -> { platform_is :darwin and ENV['GITHUB_ACTIONS'] } do # frequent timeout/hang on macOS in GitHub Actions | ||
require 'rubygems' | ||
require 'rubygems/command_manager' | ||
require 'rubygems' | ||
require 'rubygems/command_manager' | ||
|
||
describe "CVE-2019-8325 is resisted by" do | ||
describe "sanitising error message components" do | ||
it "for the 'while executing' message" do | ||
manager = Gem::CommandManager.new | ||
def manager.process_args(args, build_args) | ||
raise StandardError, "\e]2;nyan\a" | ||
end | ||
def manager.terminate_interaction(n) | ||
end | ||
manager.should_receive(:alert_error).with("While executing gem ... (StandardError)\n .]2;nyan.") | ||
manager.run nil, nil | ||
describe "CVE-2019-8325 is resisted by" do | ||
describe "sanitising error message components" do | ||
it "for the 'while executing' message" do | ||
manager = Gem::CommandManager.new | ||
def manager.process_args(args, build_args) | ||
raise StandardError, "\e]2;nyan\a" | ||
end | ||
def manager.terminate_interaction(n) | ||
end | ||
manager.should_receive(:alert_error).with("While executing gem ... (StandardError)\n .]2;nyan.") | ||
manager.run nil, nil | ||
end | ||
|
||
it "for the 'invalid option' message" do | ||
manager = Gem::CommandManager.new | ||
def manager.terminate_interaction(n) | ||
end | ||
manager.should_receive(:alert_error).with("Invalid option: --.]2;nyan.. See 'gem --help'.") | ||
manager.process_args ["--\e]2;nyan\a"], nil | ||
it "for the 'invalid option' message" do | ||
manager = Gem::CommandManager.new | ||
def manager.terminate_interaction(n) | ||
end | ||
manager.should_receive(:alert_error).with("Invalid option: --.]2;nyan.. See 'gem --help'.") | ||
manager.process_args ["--\e]2;nyan\a"], nil | ||
end | ||
|
||
it "for the 'loading command' message" do | ||
manager = Gem::CommandManager.new | ||
def manager.require(x) | ||
raise 'foo' | ||
end | ||
manager.should_receive(:alert_error).with("Loading command: .]2;nyan. (RuntimeError)\n\tfoo") | ||
manager.send :load_and_instantiate, "\e]2;nyan\a" | ||
it "for the 'loading command' message" do | ||
manager = Gem::CommandManager.new | ||
def manager.require(x) | ||
raise 'foo' | ||
end | ||
manager.should_receive(:alert_error).with("Loading command: .]2;nyan. (RuntimeError)\n\tfoo") | ||
manager.send :load_and_instantiate, "\e]2;nyan\a" | ||
end | ||
end | ||
end |
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