Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Windows): add -TestsDebug parameter to build.ps1 #828

Closed

Conversation

lemeurherve
Copy link
Member

@lemeurherve lemeurherve commented Jun 23, 2024

This PR introduces -TestsDebug parameter to build.ps1.

With it we can use -TestsDebug parameter or $env:TESTS_DEBUG to improve Windows tests debugging:

  • As it can be passed in the Jenkinsfile, it's easy now to activate it on a build replay instead of having to add a commit to switch debug on or off.
  • This parameter can take the following values:
    • empty/undefined: no additional debug (default value).
    • debug: output every test command and stderr on top of every test. (Equivalent of setting $quiet=$true in the test_helpers "Run-Program" function currently)
    • verbose: same as debug + output of stdout.
Output (from docker-ssh-agent pull request):

With .\build.ps1 test -TestsDebug 'debug':
image

With .\build.ps1 test -TestsDebug 'verbose':
image

Similar to:

Testing done

Local tests + CI

Replay with -TestsDebug set to "verbose" and only one Windows image type to validate the functionality:

  • diff
    --- old/Jenkinsfile
    +++ new/Jenkinsfile
    @@ -24,7 +24,7 @@
                     axes {
                         axis {
                             name 'IMAGE_TYPE'
    -                        values 'linux', 'nanoserver-1809', 'nanoserver-ltsc2019', 'nanoserver-ltsc2022', 'windowsservercore-1809', 'windowsservercore-ltsc2019', 'windowsservercore-ltsc2022'
    +                        values 'nanoserver-1809'
                         }
                     }
                     stages {
    @@ -63,7 +63,7 @@
                                                 // If the tests are passing for Linux AMD64, then we can build all the CPU architectures
                                                 sh 'docker buildx bake --file docker-bake.hcl linux'
                                             } else {
    -                                            powershell '& ./build.ps1 test'
    +                                            powershell '& ./build.ps1 test -TestsDebug verbose'
                                             }
                                         }
                                     }
  • https://ci.jenkins.io/job/Packaging/job/docker-agent/job/PR-828/2/

Submitter checklist

@lemeurherve
Copy link
Member Author

Note: this change is also included in #827, I created this distinct pull request to check outputs while working on it.

Prefer reviewing #827 instead of this one.

@lemeurherve
Copy link
Member Author

Closing in favor of #827

@lemeurherve lemeurherve deleted the chore-windows-add-testsdebug branch July 17, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant