Skip to content

Commit

Permalink
more tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
danielparks committed Feb 15, 2024
1 parent 6b06d9b commit 02ae1d2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
agent: ['puppet7', 'puppet8']
agent:
#- puppet7
- puppet8
runs-on: ${{ matrix.os }}

steps:
Expand Down
3 changes: 3 additions & 0 deletions lib/puppet/provider/rustup_exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def ensure_not_absent; end

# Determine if `rustup` has been installed on the system for this user
def rustup_installed?
if ENV['RUSTUP_TRACE']
warn("rustup_installed? #{File.file? rustup_path} (#{rustup_path})")
end
File.file? rustup_path
end

Expand Down
1 change: 1 addition & 0 deletions lib/puppet/provider/rustup_internal/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def exists?
# The resource thinks we need to install `rustup`.
def create
url = URI.parse(resource[:installer_source])
warn "create rustup: download #{url}"

# Puppet::Util::Execution.execute can’t accept an IO stream or a string as
# stdin, so we save the script as a file and pipe it into stdin. (We don’t
Expand Down
8 changes: 8 additions & 0 deletions spec/acceptance/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,9 @@
it 'can remove itself after the user was deleted' do
rm_user('rustup_test')

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

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

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

puts "run 2"
puts apply_manifest(<<~'END', catch_failures: true, prefix_command: 'RUSTUP_TRACE=1 ').stderr
user { 'rustup_test':
ensure => absent,
Expand Down

0 comments on commit 02ae1d2

Please sign in to comment.