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

refactor: Refactored to use an extension controller + require return types #92

Merged
merged 18 commits into from
Aug 12, 2024

Conversation

bmingles
Copy link
Collaborator

@bmingles bmingles commented Aug 8, 2024

  • Refactored extension module to use a controller class. This should make things easier to test and encourages better architecture
  • Enabled linting rule to require return types + fixed offending code

supports #79

Copy link

github-actions bot commented Aug 8, 2024

End-to-end Test Summary

Tests 📝Passed ✅Failed ❌Skipped ⏭️Pending ⏳Other ❓Flaky 🍂Duration ⏱️
330000002:03:52
A ctrf plugin

Detailed Test Results

NameStatusmsFlaky 🍂
should be able to load VSCodepassed ✅1102
should only be visible when a supported file type is active: test.groovypassed ✅2661
should only be visible when a supported file type is active: test.pypassed ✅1194
A ctrf plugin

Failed Test Summary

No failed tests ✨

Flaky Test Summary

No flaky tests detected. ✨

Copy link

github-actions bot commented Aug 8, 2024

Unit Test Summary

Tests 📝Passed ✅Failed ❌Skipped ⏭️Pending ⏳Other ❓Flaky 🍂Duration ⏱️
25250000000:00:00
A ctrf plugin

Detailed Test Results

NameStatusmsFlaky 🍂
src/services/Config.spec.ts: Config > should return core servers: Empty configpassed ✅2
src/services/Config.spec.ts: Config > should return core servers: String configpassed ✅1
src/services/Config.spec.ts: Config > should return core servers: Default urlpassed ✅0
src/services/Config.spec.ts: Config > should return core servers: Full configpassed ✅1
src/util/ExtendedMap.spec.ts: ExtendedMap Test Suite > getOrThrowpassed ✅1
src/util/assertUtil.spec.ts: assertDefined > should not throw if value is defined: {}passed ✅2
src/util/assertUtil.spec.ts: assertDefined > should not throw if value is defined: testpassed ✅1
src/util/assertUtil.spec.ts: assertDefined > should not throw if value is defined: 999passed ✅0
src/util/assertUtil.spec.ts: assertDefined > should not throw if value is defined: truepassed ✅0
src/util/assertUtil.spec.ts: assertDefined > should not throw if value is defined: falsepassed ✅1
src/util/assertUtil.spec.ts: assertDefined > should not throw if value is defined: 2024-08-08T22:22:22.273Zpassed ✅0
src/util/assertUtil.spec.ts: assertDefined > should throw an error for null or undefined values: nullpassed ✅1
src/util/assertUtil.spec.ts: assertDefined > should throw an error for null or undefined values: undefinedpassed ✅0
src/util/downloadUtils.spec.ts: getTempDir > should create temp directory if it does not already exist: true, undefinedpassed ✅6
src/util/downloadUtils.spec.ts: getTempDir > should create temp directory if it does not already exist: true, subDirectorypassed ✅1
src/util/downloadUtils.spec.ts: getTempDir > should create temp directory if it does not already exist: false, undefinedpassed ✅0
src/util/downloadUtils.spec.ts: getTempDir > should create temp directory if it does not already exist: false, subDirectorypassed ✅1
src/util/downloadUtils.spec.ts: getTempDir > should remove directory if recreate is true: true, undefined, /home/runner/work/vscode-deephaven/vscode-deephaven/src/tmppassed ✅1
src/util/downloadUtils.spec.ts: getTempDir > should remove directory if recreate is true: true, subDirectory, /home/runner/work/vscode-deephaven/vscode-deephaven/src/tmp/subDirectorypassed ✅3
src/util/downloadUtils.spec.ts: getTempDir > should remove directory if recreate is true: false, undefined, /home/runner/work/vscode-deephaven/vscode-deephaven/src/tmppassed ✅0
src/util/downloadUtils.spec.ts: getTempDir > should remove directory if recreate is true: false, subDirectory, /home/runner/work/vscode-deephaven/vscode-deephaven/src/tmp/subDirectorypassed ✅1
src/util/urlUtils.spec.ts: urlUtils > should convert url to host_port string: http://localhost:4000, localhost_4000passed ✅2
src/util/urlUtils.spec.ts: urlUtils > should convert url to host_port string: https://localhost:5000, localhost_5000passed ✅0
src/util/urlUtils.spec.ts: urlUtils > should convert url to host_port string: http://www.acme.com:6000, www_acme_com_6000passed ✅0
src/util/urlUtils.spec.ts: urlUtils > should convert url to host_port string: https://www.acme.com:7000, www_acme_com_7000passed ✅0
A ctrf plugin

Failed Test Summary

No failed tests ✨

Flaky Test Summary

No flaky tests detected. ✨

@bmingles bmingles requested a review from mofojed August 8, 2024 21:07
@bmingles bmingles self-assigned this Aug 12, 2024
@bmingles bmingles linked an issue Aug 12, 2024 that may be closed by this pull request
src/extension.ts Show resolved Hide resolved
* @param dependency The value to assert.
* @param name The name of the value to include in the error message if the assertion fails.
*/
export function assertDefined<T>(
Copy link
Member

Choose a reason for hiding this comment

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

Pretty much the same as assertNotNull in @deephaven/utils, not sure it's worth re-defining.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like installing @deephaven/utils is going to take some extra work:
image

I've created @deephaven/utils - errors when installing in vscode extension #2185 to address changes needed in web-client-ui and Replace assertDefined with @deephaven/utils assertNotNull #95 as a follow up in the extension.

@bmingles bmingles requested a review from mofojed August 12, 2024 15:14
@bmingles bmingles merged commit 83050dc into main Aug 12, 2024
3 checks passed
@bmingles bmingles deleted the 79-2-extension-controller branch August 12, 2024 19:05
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.

Fetch DHE js api from server
2 participants