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

Add tests for the Swift snippets workflows #1126

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

award999
Copy link
Contributor

@award999 award999 commented Oct 7, 2024

  • Created some common utilities for dealing with debug sessions
  • Add integration test for run command and debug variant, big difference
    being whether the breakpoint is hit or not

Issue: #1125

vscode.debug.removeBreakpoints(breakpoints);
});

test("Run `Swift: Run Swift Snippet` command for snippet file", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mark as `@slow before merging, just want to make sure passes in CI

expect(session.configuration).to.have.property("noDebug", true);
}).timeout(120000);

test("Run `Swift: Debug Swift Snippet` command for snippet file", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mark as `@slow before merging, just want to make sure passes in CI

@michael-weng
Copy link
Contributor

The CI will probably make this apparent so might just be stating the obvious here, but snippet's only implemented in 5.7 so probably need to set some precondition.
https://github.com/swiftlang/swift-evolution/blob/main/proposals/0356-swift-snippets.md

@award999
Copy link
Contributor Author

award999 commented Oct 8, 2024

The CI will probably make this apparent so might just be stating the obvious here, but snippet's only implemented in 5.7 so probably need to set some precondition. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0356-swift-snippets.md

yep thanks :), also seems like it was hidden behind an experimental flag for a bit so trying to run that down

@michael-weng
Copy link
Contributor

The CI will probably make this apparent so might just be stating the obvious here, but snippet's only implemented in 5.7 so probably need to set some precondition. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0356-swift-snippets.md

yep thanks :), also seems like it was hidden behind an experimental flag for a bit so trying to run that down

Nice! If it's a particular flag we are expecting would be a good candidate for a separate contract test, and if anything were to change we will know explicit the contract with the driver's broken.

* Created some common utilities for dealing with debug sessions
* Add integration test for run command and debug variant, big difference
  being whether the breakpoint is hit or not

Issue: swiftlang#1125
CodeLLDB is not working with older toolchains so need to use lldb-dap

suiteSetup(async function () {
const folder = await folderContextPromise("defaultPackage");
if (folder.workspaceContext.toolchain.swiftVersion.isLessThan(new Version(6, 0, 0))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC the source specified 5.7 for snippet feature, something in the CI hindering us I guess?

michael-weng added a commit to michael-weng/vscode-swift that referenced this pull request Oct 31, 2024
- Added comments for clarification
- Added utilities to listen for dap message, this is useful for test
synchronization. Code takes inspiration from
swiftlang#1126
michael-weng added a commit to michael-weng/vscode-swift that referenced this pull request Oct 31, 2024
- Added comments for clarification
- Added utilities to listen for dap message, this is useful for test
synchronization. Code takes inspiration from
swiftlang#1126
michael-weng added a commit to michael-weng/vscode-swift that referenced this pull request Nov 4, 2024
- Added comments for clarification
- Added utilities to listen for dap message, this is useful for test
synchronization. Code takes inspiration from
swiftlang#1126
michael-weng added a commit to michael-weng/vscode-swift that referenced this pull request Nov 5, 2024
- Added comments for clarification
- Added utilities to listen for dap message, this is useful for test
synchronization. Code takes inspiration from
swiftlang#1126
award999 pushed a commit that referenced this pull request Nov 8, 2024
* Add integration tests for build commands

- Validate the workflow of user calling the
Swift: Run Build/Clean Build/Debug Build commands.
- Ensure Swift: Run Build will not get blocked by pre-set breakpoint.
- Ensure Swift: Clean Build will result in a cleaned up .build folder.
- Ensure Swift: Debug Build will stop on a breakpoint and resume.

Issue: #1184

* - Added module enum for workbench commands string constant
- Added comments for clarification
- Added utilities to listen for dap message, this is useful for test
synchronization. Code takes inspiration from
#1126

* - Rename from utilies/command.ts to utilies/commands.ts
- Minor cosmetic change to utilies/commands.ts

* - Fix a bug in updateSettings where promise is not being exlicitly
returned, causing restore of setting being not awaitable
- Make makeDebugConfigurations to be awaitable
- Change launch to also update the key for ASLR disable settings
- Make the test properly set up and reset the settings that update the
launch config
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