diff options
Diffstat (limited to 'qa/spec/service/shellout_spec.rb')
-rw-r--r-- | qa/spec/service/shellout_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/qa/spec/service/shellout_spec.rb b/qa/spec/service/shellout_spec.rb index 9d7adeb0e94..52f095f165a 100644 --- a/qa/spec/service/shellout_spec.rb +++ b/qa/spec/service/shellout_spec.rb @@ -13,6 +13,12 @@ module QA allow(Open3).to receive(:popen2e).and_yield(stdin, stdout, wait_thread) end + it 'masks secrets when logging the command itself' do + expect(Runtime::Logger).to receive(:info).with('Executing: `docker login -u **** -p ****`') + expect(wait_thread).to receive(:value).twice.and_return(non_errored_wait) + subject.shell('docker login -u user -p secret', mask_secrets: %w[secret user]) + end + it 'masks command secrets on CommandError' do expect(wait_thread).to receive(:value).twice.and_return(errored_wait) |