Skip to content

Commit 02ae1d2

Browse files
committed
more tracing
1 parent 6b06d9b commit 02ae1d2

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

.github/workflows/pr-checks.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ jobs:
5858
strategy:
5959
matrix:
6060
os: ['ubuntu-latest']
61-
agent: ['puppet7', 'puppet8']
61+
agent:
62+
#- puppet7
63+
- puppet8
6264
runs-on: ${{ matrix.os }}
6365

6466
steps:

lib/puppet/provider/rustup_exec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ def ensure_not_absent; end
8282

8383
# Determine if `rustup` has been installed on the system for this user
8484
def rustup_installed?
85+
if ENV['RUSTUP_TRACE']
86+
warn("rustup_installed? #{File.file? rustup_path} (#{rustup_path})")
87+
end
8588
File.file? rustup_path
8689
end
8790

lib/puppet/provider/rustup_internal/default.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def exists?
3232
# The resource thinks we need to install `rustup`.
3333
def create
3434
url = URI.parse(resource[:installer_source])
35+
warn "create rustup: download #{url}"
3536

3637
# Puppet::Util::Execution.execute can’t accept an IO stream or a string as
3738
# stdin, so we save the script as a file and pipe it into stdin. (We don’t

spec/acceptance/user_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@
369369
it 'can remove itself after the user was deleted' do
370370
rm_user('rustup_test')
371371

372+
puts "default cargo home"
373+
puts Dir.entries("/home/rustup_test").sort rescue puts "no /home/rustup_test"
374+
puts "run 1"
372375
puts apply_manifest(<<~'END', catch_failures: true, prefix_command: 'RUSTUP_TRACE=1 ').stderr
373376
user { 'rustup_test':
374377
ensure => present,
@@ -394,6 +397,7 @@
394397
expect(file('/home/rustup_test/.bashrc').content)
395398
.to eq %(# .bashrc\n. "$HOME/.cargo/env"\n)
396399

400+
puts "run 2"
397401
puts apply_manifest(<<~'END', catch_failures: true, prefix_command: 'RUSTUP_TRACE=1 ').stderr
398402
user { 'rustup_test':
399403
ensure => absent,
@@ -424,6 +428,9 @@
424428
it 'can remove itself after the user was deleted (with custom cargo_home)' do
425429
rm_user('rustup_test')
426430

431+
puts "custom cargo_home"
432+
puts Dir.entries("/home/rustup_test").sort rescue puts "no /home/rustup_test"
433+
puts "run 1"
427434
puts apply_manifest(<<~'END', catch_failures: true, prefix_command: 'RUSTUP_TRACE=1 ').stderr
428435
user { 'rustup_test':
429436
ensure => present,
@@ -459,6 +466,7 @@
459466
expect(file('/home/rustup_test/.bashrc').content)
460467
.to eq %(# .bashrc\n. "/home/rustup_test/a/b/.cargo/env"\n)
461468

469+
puts "run 2"
462470
puts apply_manifest(<<~'END', catch_failures: true, prefix_command: 'RUSTUP_TRACE=1 ').stderr
463471
user { 'rustup_test':
464472
ensure => absent,

0 commit comments

Comments
 (0)