Skip to content

Windows unit testing#145

Merged
lucaspin merged 105 commits intomasterfrom
windows-unit-testing
Mar 10, 2022
Merged

Windows unit testing#145
lucaspin merged 105 commits intomasterfrom
windows-unit-testing

Conversation

@lucaspin
Copy link
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🙈

Comment thread pkg/shell/process.go
* 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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👁️

@shiroyasha
Copy link
Copy Markdown
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