Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: support projects with namespace but org without replay debugger W-19604488#6579

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mshanemc wants to merge43 commits intodevelop
base:develop
Choose a base branch
Loading
fromsm/namespace-bugs-part-2

Conversation

@mshanemc
Copy link
Contributor

What does this PR do?

primary

other

  • refactoring and simplifying that test tree view and the test command code (see PR notes)

What issues does this PR fix or reference?

@W-19604488@

QA both the WI issue and some general "around the test runner"

@mshanemcmshanemc requested a review froma team as acode ownerOctober 2, 2025 14:51
@mshanemcmshanemc requested a review fromsmarvezOctober 2, 2025 14:51
publicerrorMessage:string='';
publicstackTrace:string='';
publicoutcome='Not Run';
publicreadonlyoutcome:TestOutcome='Skip';
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

set viaupdateOutcome instead of having to set it and then call updateOutcome on it.

Method
}

exportclassApexTestRunner{
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

didn't need to be a class. Only 1 method was using the outlineProvider.

that event emitter was even sillier (letting one method call another, I think to get around somthing not being async).

@daphne-sfdcdaphne-sfdc requested review fromdaphne-sfdc and removed request forsmarvezOctober 9, 2025 17:37
import{DebugProtocol}from'@vscode/debugprotocol';

exportclassBreakpointUtil{
privatestaticinstance:BreakpointUtil;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

a bunch of this was either completely unused or used only for testing.

exposing the 2 maps simplifies things a lot

}
}

exportconstbreakpointUtil=newBreakpointUtil();
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

you can instantiate a class and export that instance instead of doing all the singleon pattern getInstance boilerplate

publicsetOverlaySuccessResult(overlaySuccessResult:ApexExecutionOverlayResultCommandSuccess):void{
this.overlaySuccessResut=overlaySuccessResult;
}
exporttypeApexHeapDump={
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

you don't need a class just to make some immutable props.
if you see a getter/setter on the same prop, without any fancy mutation, that's just a public mutable property wasted code

import{LogContext}from'./logContext';
import{substringUpToLastPeriod,substringFromLastPeriod}from'./logContextUtil';

exportclassHeapDumpService{
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

this ones ugly so I stopped short.

* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

exportclassLogContextUtil{
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

this was passed around, mocked, and attached to other classes but shouldn't have been a class

};

exporttypeApexExecutionOverlayResultCommandSuccess={
exporttypeApexExecutionOverlayResult={
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

renamed to match tooling API types

}
}));

jest.mock('../../../src/core/logContextUtil',()=>({
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

how to mock a standalone fn so you don't need classes

symbols:['theInt'],
value:{
value:5
constheapdump:ApexHeapDump={
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

the mocks were not very accurate, which was why theassertions were needed. AI is good for realistic mocks, keeps working until the compiler is satisfied.

why not test with realistic data?

consttyperefMapping:Map<string,string>=newMap();
typerefMapping.set('foo','file:///foo.cls');
typerefMapping.set('bar','file:///bar.cls');
constlineNumberMapping:Map<string,number[]>=newMap([
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

maps have a ctor

});

it('ApexExecutionOverlayResultCommand GET REST call with parse-able heapdump success result',async()=>{
overlayResultCommand=newApexExecutionOverlayResultCommand(heapdumpKey);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

mock a json server response, the parse the mocked json and make sure JSON.parse worked? that's a dumb test.

}
}

exportclassEmptyPreCheckerimplementsPreconditionChecker{
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

unused

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

this pkg just has a bit of cleanup

returntestResult.codecoverage??testResult.coverage.coverage;
};

constisApexMetadata=(filePath:string):boolean=>IS_CLS_OR_TRIGGER.test(filePath);
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

string methods > regex

location:vscode.Location;
};

exportclassApexLSPConverter{
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

no reason for a class

awaitactivationTracker.markActivationStop();
};

exportconstretrieveLineBreakpointInfo=async():Promise<boolean>=>{
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

moved out of index to its own file

privatechildren:BaseNode[]=[];
publiccheckpointOverlayAction:ApexExecutionOverlayAction;
privateuri:string;
privateenabled:boolean;
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

nothing was using the actionObjectId. It was set but never read.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@daphne-sfdcdaphne-sfdcdaphne-sfdc left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@mshanemc@daphne-sfdc

[8]ページ先頭

©2009-2025 Movatter.jp