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: improve Windows tests debug and small code cleanup #396

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

lemeurherve
Copy link
Member

@lemeurherve lemeurherve commented Apr 28, 2024

This PR extracts tests debug improvement and small code cleanup from #388 and #295.

  • We can now 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.
    • I tried using Powershell preference variables but didn't managed to get their values in the test_helpers functions without having to pass them around every call from ./build.ps1 to ./tests/sshAgent.ps1 to ./tests/test_helpers.ps1.
    • Using Run-Program in the beforeAll step of all tests involving SSH instead of calling docker directly so we can easily retrieve the commands used to reproduce them locally.
  • Small code cleanup, mainly double quotes replacements by simple quotes, no functional change.
  • Set build timeout from 30 to 60 minutes as builds take just about 30 minutes now.
  • Added a section to the README explaining how to build and test Windows images locally.
Output:

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

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

Testing done

Local tests + CI

Submitter checklist

Edit tasklist title
Beta Give feedback Tasklist Submitter checklist, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
    Options
  2. Ensure that the pull request title represents the desired changelog entry
    Options
  3. Please describe what you did
    Options
  4. Link to relevant issues in GitHub or Jira
    Options
  5. Link to relevant pull requests, esp. upstream and downstream changes
    Options
  6. Ensure you have provided tests - that demonstrates feature works or fixes the issue
    Options
Loading

@lemeurherve lemeurherve requested a review from a team as a code owner April 28, 2024 21:59
@lemeurherve lemeurherve changed the title Improve tests chore: improve Windows tests debug and small code cleanup Apr 28, 2024
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.

None yet

2 participants