Skip to content

Commit 8ce362f

Browse files
committed
Revert "update tests to work on GHA runners"
This reverts commit 12347db.
1 parent 12347db commit 8ce362f

File tree

3 files changed

+7
-24
lines changed

3 files changed

+7
-24
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636

3737
- name: run specs
3838
run: |
39+
curl -o- https://raw.githubusercontent.com/bugsnag/bugsnag-cli/main/install.sh | bash
3940
bundle config path vendor/fastlane-bundle
4041
bundle install --gemfile=tools/fastlane-plugin/Gemfile
4142
cd tools/fastlane-plugin

tools/fastlane-plugin/spec/bugsnag_upload_dsym_action_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,16 @@ def run_with args
148148
end
149149

150150
it 'accepts a custom bugsnag_cli_path as an option' do
151-
expect(Kernel).to receive(:system).with("#{CUSTOM_BUGSNAG_CLI_PATH} upload dsym --project-root #{Dir::pwd} \"#{FIXTURE_PATH}\"").and_return(true)
152-
run_with({dsym_path: FIXTURE_PATH, bugsnag_cli_path: CUSTOM_BUGSNAG_CLI_PATH})
151+
custom_cli_path = File.join(ENV['HOME'], ".local/bugsnag/bin/bugsnag-cli")
152+
expect(Kernel).to receive(:system).with("#{custom_cli_path} upload dsym --project-root #{Dir::pwd} \"#{FIXTURE_PATH}\"").and_return(true)
153+
run_with({dsym_path: FIXTURE_PATH, bugsnag_cli_path: custom_cli_path})
153154
end
154155

155156
it 'accepts a custom bugsnag_cli_path with an API key' do
157+
custom_cli_path = File.join(ENV['HOME'], ".local/bugsnag/bin/bugsnag-cli")
156158
api_key = "123456789012345678901234567890FF"
157-
expect(Kernel).to receive(:system).with("#{CUSTOM_BUGSNAG_CLI_PATH} upload dsym --api-key #{api_key} --project-root #{Dir::pwd} \"#{FIXTURE_PATH}\"").and_return(true)
158-
run_with({dsym_path: FIXTURE_PATH, api_key: api_key, bugsnag_cli_path: CUSTOM_BUGSNAG_CLI_PATH})
159+
expect(Kernel).to receive(:system).with("#{custom_cli_path} upload dsym --api-key #{api_key} --project-root #{Dir::pwd} \"#{FIXTURE_PATH}\"").and_return(true)
160+
run_with({dsym_path: FIXTURE_PATH, api_key: api_key, bugsnag_cli_path: custom_cli_path})
159161
end
160162
end
161163
end

tools/fastlane-plugin/spec/spec_helper.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,4 @@ module SpecHelper
77
require 'fastlane' # to import the Action super class
88
require 'fastlane/plugin/bugsnag' # import the actual plugin
99

10-
def current_os_and_arch
11-
os = case RbConfig::CONFIG['host_os']
12-
when /darwin/ then 'macos'
13-
when /linux/ then 'linux'
14-
when /mswin|mingw/ then 'windows'
15-
else raise "Unsupported OS: #{RbConfig::CONFIG['host_os']}"
16-
end
17-
18-
arch = case RbConfig::CONFIG['host_cpu']
19-
when /x86_64/ then 'x86_64'
20-
when /i386/ then 'i386'
21-
when /arm64/ then 'arm64'
22-
else raise "Unsupported architecture: #{RbConfig::CONFIG['host_cpu']}"
23-
end
24-
25-
"#{arch}-#{os}"
26-
end
27-
2810
FIXTURE_PATH = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures'))
29-
BUGSNAG_CLI_BIN_PATH = File.expand_path(File.join(File.dirname(__FILE__), '..','..' ,'..','..','bugsnag-cli', 'bin'))
30-
CUSTOM_BUGSNAG_CLI_PATH = File.join(BUGSNAG_CLI_BIN_PATH, "#{current_os_and_arch}-bugsnag-cli")

0 commit comments

Comments
 (0)