Skip to content

Commit

Permalink
Merge pull request #53 from Dynatrace/fix/debugLogging
Browse files Browse the repository at this point in the history
fix issue with debug mode logging, add tests for debug logging
  • Loading branch information
Ralph1300 authored Jun 24, 2024
2 parents f751f9c + 5f60a79 commit f3a0b8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/fastlane/plugin/dynatrace/actions/dynatrace_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def self.run(params)
# Create the full shell command to trigger the DTXDssClient
shell_command = command.join(' ')

UI.message "#{print_command}" if params[:debugMode] == true
UI.message "#{shell_command}" if params[:debugMode] == true

Fastlane::Actions.sh("#{shell_command}", log: params[:debugMode] == true, error_callback: ->(result) {
# ShAction doesn't return any reference to the return value -> parse it from the output
Expand Down
14 changes: 13 additions & 1 deletion spec/dynatrace_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ def mock_dict (
os,
symbolsfile = Dir.pwd + "/spec/testdata/android-mapping-test.txt",
customLLDBFrameworkPath: nil,
autoSymlinkLLDB: nil
autoSymlinkLLDB: nil,
debugMode: nil
)
dict = {
:action => "-upload",
Expand All @@ -54,6 +55,10 @@ def mock_dict (
dict[:autoSymlinkLLDB] = autoSymlinkLLDB
end

unless debugMode.nil?
dict[:debugMode] = debugMode
end

return dict
end

Expand Down Expand Up @@ -195,6 +200,13 @@ def mock_dict (

expect(lldb_symlink_exists?(@destination_path)).to eql(false)
end

it "test with debug mode" do
flhash = FastlaneCore::Configuration.create(mock_config, mock_dict("ios", debugMode: true))
Fastlane::Actions::DynatraceProcessSymbolsAction.run(flhash)

expect(lldb_symlink_exists?(@destination_path)).to eql(false)
end
end

context "when valid customLLDBFrameWorkPath provided" do
Expand Down

0 comments on commit f3a0b8c

Please sign in to comment.