Skip to content

(test): fix glob mode match and remove duplicate loader.js in renderer.html#183507

Closed
yiliang114 wants to merge 9 commits intomicrosoft:mainfrom
yiliang114:unwilling-cattle
Closed

(test): fix glob mode match and remove duplicate loader.js in renderer.html#183507
yiliang114 wants to merge 9 commits intomicrosoft:mainfrom
yiliang114:unwilling-cattle

Conversation

@yiliang114
Copy link
Copy Markdown
Contributor

Close #183506

Comment on lines +109 to +110
// During unit testing, it may be empty and needs.
viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.Sidebar)?.id || '',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this needed? Are any tests currently failing because of this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Why is this needed? Are any tests currently failing because of this?

Now the existing unit tests in VS Code are not executed into the SidebarPart constructor, so this writing (use ! rather than ? ) does not cause unit test execution to fail. The reason I encountered unit test failure is that I did not use TestSidebarPart , but directly use SidebarPart.

this.parts.set(ViewContainerLocation.Sidebar, new TestSideBarPart());

When I need to initialize SidebarPart, it will report an error because I haven't registered any other views at the time of unit testing.

Another reason is that other modules are fetched using optional chain processing, because there is no guarantee that there will be a default view container.

image

// .describe('grep', 'only run tests matching <pattern>').alias('grep', 'g').alias('grep', 'f').string('grep')
.describe('build', 'run with build output (out-build)').boolean('build')
.describe('run', 'only run tests matching <relative_file_path>').string('run')
.describe('glob', 'only run tests matching <pattern>').string('glob')
Copy link
Copy Markdown
Member

@connor4312 connor4312 May 26, 2023

Choose a reason for hiding this comment

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

This should be runGlob to match our other unit test types, and be described as "only run test files matching..."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This should be runGlob to match our other unit test types, and be described as "only run test files matching..."

emmmm, but in

- to run only a subset of tests use the `--run` or `--glob` options
and
// glob patterns (--glob)
, It seems that the supported parameter is --glob. Has it been abandoned?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like in the electron test we allow both glob and runGlob, so I guess that's fine. I would add a similar .alias('glob', 'runGlob') just for consistency's sake

@connor4312 connor4312 assigned sbatten and unassigned connor4312 May 26, 2023
@yiliang114 yiliang114 requested a review from connor4312 August 15, 2023 16:22
@connor4312 connor4312 assigned connor4312 and unassigned sbatten Sep 5, 2023
connor4312
connor4312 previously approved these changes Sep 5, 2023
@connor4312 connor4312 added this to the September 2023 milestone Sep 5, 2023
roblourens
roblourens previously approved these changes Sep 5, 2023
@connor4312 connor4312 enabled auto-merge (squash) September 5, 2023 23:34
@connor4312 connor4312 modified the milestones: September 2023, On Deck Sep 27, 2023
auto-merge was automatically disabled October 8, 2023 12:08

Head branch was pushed to by a user without write access

@yiliang114 yiliang114 dismissed stale reviews from roblourens and connor4312 via 34f628c October 8, 2023 12:08
@yiliang114
Copy link
Copy Markdown
Contributor Author

has been merged the latest code from main, Can you help me look at the code again when you are free? @roblourens @connor4312

@connor4312
Copy link
Copy Markdown
Member

These files were reworked recently, I reapplied the necessary change in #199979

@connor4312 connor4312 closed this Dec 4, 2023
connor4312 added a commit that referenced this pull request Dec 4, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some Unit Test Problems

4 participants