diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 47a516b7..130b7da5 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -20,7 +20,7 @@ permissions: jobs: integration: name: Integration - runs-on: windows-latest + runs-on: windows-2025 strategy: matrix: ruby: [3.2] @@ -43,9 +43,29 @@ jobs: - name: Install modules if: steps.modules.outputs.cache-hit != 'true' run: bundle exec r10k puppetfile install + - name: Output powershell version + run: $PSVersionTable + - name: List trusted WSMan hosts + run: Get-Item WSMan:\localhost\Client\TrustedHosts + - name: Output WinRM logs + run: winrm enumerate winrm/config/listener + - name: Test WSMan connection + run: Test-WSMan localhost - uses: ./.github/actions/windows_agent_setup - - name: Run tests - run: bundle exec rake ci:windows:integration + - name: Run test + run: bundle exec rake ci:windows:integration --trace -v + - name: Sessions + if: always() + run: Get-PSSession + - name: Test WSMan connection + if: always() + run: Test-WSMan localhost + - name: Print EventLog + if: always() + run: winrm enumerate winrm/config/Listener + - name: Print EventLog + if: always() + run: Get-WinEvent -ListLog *winrm* | fl * agentless: name: Agentless diff --git a/scripts/ci.ps1 b/scripts/ci.ps1 index 85cdff43..939f271a 100644 --- a/scripts/ci.ps1 +++ b/scripts/ci.ps1 @@ -155,4 +155,5 @@ Enable-PSRemoting Set-WSManQuickConfig -Force Set-WinRMHostConfiguration Test-WinRMConfiguration @User | Out-Null +winrm enumerate winrm/config/Listener Add-Content -Path $ENV:GITHUB_ENV -Value "BOLT_WINRM_PASSWORD=$pass" diff --git a/spec/integration/apply_spec.rb b/spec/integration/apply_spec.rb index aad2c2e9..2872875e 100644 --- a/spec/integration/apply_spec.rb +++ b/spec/integration/apply_spec.rb @@ -34,7 +34,8 @@ # The following are run with both *nix and Windows targets. shared_examples 'agentful tests' do |targets| - it 'runs a ruby task' do + it 'lists all modules & runs a ruby task' do + run_cli_json(%w[module show], project: project) results = run_cli_json(%W[task run basic::ruby_task -t #{targets}], project: project) results['items'].each do |result|