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

Windows unit testing #145

Merged
merged 105 commits into from
Mar 10, 2022
Merged

Windows unit testing #145

merged 105 commits into from
Mar 10, 2022

Conversation

lucaspin
Copy link
Contributor

@lucaspin lucaspin commented Mar 8, 2022

Relies on #144.

  • Uses Github Actions to run our Windows tests for now (until we have a Windows stack ourselves)
  • All shell executor E2Es are converted to Golang tests (only the hosted ssh_jump_point one is left)
  • Use gotestsum to run unit tests and publish test-results
  • job_log.json files now use the job_log_{EpochNanos}.json naming convention to avoid name clashing while testing, and are always removed when the logger is closed
  • Process.writeCommandToFile() changes to use a UTF-8 BOM in Windows in order to support unicode in PowerShell
  • New test/support/commands.go file to help with commands in testing for bash and powershell
  • New test/support/hub.go to mock the hub to which the agent registers and syncs
  • New test/support/loghub.go to mock the hub to which the agents pushes logs to

@lucaspin lucaspin mentioned this pull request Mar 8, 2022
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Test
run: gotestsum --format short-verbose --packages="./..." -- -p 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

* UTF8 files without a BOM containing non-ASCII characters may break in Windows PowerShell,
* since it misinterprets it as being encoded in the legacy "ANSI" codepage.
* Since we need to support non-ASCII characters, we need a UTF-8 file with a BOM.
* See: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_character_encoding
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👁️

@shiroyasha
Copy link
Contributor

Everything is clean. Nice work 👏

Base automatically changed from windows-support to master March 10, 2022 11:30
@lucaspin lucaspin merged commit e46323e into master Mar 10, 2022
@lucaspin lucaspin deleted the windows-unit-testing branch March 10, 2022 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants