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

ci: add windows testing to CI by lifting OS into its own test matrix … #2081

Merged
merged 8 commits into from
Oct 31, 2024

Conversation

filmaj
Copy link
Contributor

@filmaj filmaj commented Oct 29, 2024

  • Run tests on Windows in CI.
  • Tweak a few failing tests on Windows as a result
    • the instrumentation of user agent in web-api needs changing, as process.title can return a wide variety of results, including it can be completely overridden!
    • some cli-test functionality is skipped on Windows (graceful shutting down of processes / lack of interrupt signal support on Windows), so the relevant test executing this branch of code also needs to be skipped on windows.

@filmaj filmaj added semver:patch tests M-T: Testing work only draft labels Oct 29, 2024
@filmaj filmaj self-assigned this Oct 29, 2024
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.83%. Comparing base (1be7a9e) to head (a92d53b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2081      +/-   ##
==========================================
- Coverage   91.83%   91.83%   -0.01%     
==========================================
  Files          38       38              
  Lines       10264    10263       -1     
  Branches      646      646              
==========================================
- Hits         9426     9425       -1     
  Misses        826      826              
  Partials       12       12              
Flag Coverage Δ
cli-test 95.69% <ø> (ø)
oauth 77.39% <ø> (ø)
socket-mode 58.22% <ø> (ø)
web-api 96.88% <100.00%> (-0.01%) ⬇️
webhook 96.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@filmaj filmaj removed the draft label Oct 31, 2024
waitForOutputSpy.rejects();
await assert.rejects(platform.runStop({ proc: fakeProcess, waitForShutdown: true }));
it('non-Windows only: should reject if waitForShutdown=true and waitForOutput rejects', async () => {
if (process.platform !== 'win32') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason we don't run this test on Windows is that this code-under-test also doesn't run on Windows

assert.equal(error.code, ErrorCode.RequestError);
assert.equal(error.original.config.timeout, timeoutOverride);
assert.equal(error.original.isAxiosError, true);
assert.instanceOf(error, Error);
assert.isTrue((logger.warn as sinon.SinonStub).calledOnce, 'expected Logger to be called once');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this assert down, as it flaked a few times on Windows in CI.. next time it does, I want to make sure these other assertions about the state of the error execute.

@filmaj filmaj requested a review from a team October 31, 2024 15:25
@filmaj filmaj marked this pull request as ready for review October 31, 2024 15:25
Copy link
Member

@mwbrooks mwbrooks left a comment

Choose a reason for hiding this comment

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

Thanks for adding Windows testing! Let's give this matrix a run! 🧪 ✨

packages/web-api/src/WebClient.spec.ts Outdated Show resolved Hide resolved
Comment on lines +466 to +468
// User Agent value is different across platforms.
// on mac this is: @slack:web-api/7.7.0 node/18.15.0 darwin/23.6.0
// on windows this is: @slack:web-api/7.7.0 cmd.exe /22.10.0 win32/10.0.20348
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the detailed documentation. These kinda of notes help future maintainers a lot!

@filmaj filmaj merged commit 0711cf1 into main Oct 31, 2024
55 checks passed
@filmaj filmaj deleted the ci-windows branch October 31, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch tests M-T: Testing work only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants