@@ -198,6 +198,67 @@ suite('TestInfo', () => {
198198 const result = testInfo . prepareTestRunParams ( currentRun )
199199 assert . equal ( result , undefined )
200200 } )
201+
202+ test ( 'build target with IDE tag' , async ( ) => {
203+ const testItem = testController . createTestItem ( 'sample' , 'sample' )
204+ const testInfo = new BuildTargetTestCaseInfo ( testItem , sampleTarget )
205+
206+ // Test with IDE tag
207+ const currentRun = sandbox . createStubInstance ( TestRunTracker )
208+ sandbox . stub ( currentRun , 'originName' ) . get ( ( ) => 'sample' )
209+ currentRun . getRunProfileKind . returns ( vscode . TestRunProfileKind . Run )
210+ currentRun . getIdeTag . returns ( '--define=ide_client=cursor' )
211+
212+ const result = testInfo . prepareTestRunParams ( currentRun )
213+ assert . deepStrictEqual ( result , {
214+ arguments : [ ] ,
215+ environmentVariables : { } ,
216+ originId : 'sample' ,
217+ targets : [
218+ {
219+ uri : '//sample/target:test' ,
220+ } ,
221+ ] ,
222+ workingDirectory : '' ,
223+ dataKind : TestParamsDataKind . BazelTest ,
224+ data : {
225+ coverage : false ,
226+ additionalBazelParams : '--define=ide_client=cursor' ,
227+ } ,
228+ } )
229+ } )
230+
231+ test ( 'build target with IDE tag and debug flags' , async ( ) => {
232+ const testItem = testController . createTestItem ( 'sample' , 'sample' )
233+ const testInfo = new BuildTargetTestCaseInfo ( testItem , sampleTarget )
234+
235+ // Test with IDE tag and debug flags
236+ const currentRunWithDebug = sandbox . createStubInstance ( TestRunTracker )
237+ sandbox . stub ( currentRunWithDebug , 'originName' ) . get ( ( ) => 'sample' )
238+ currentRunWithDebug . getRunProfileKind . returns (
239+ vscode . TestRunProfileKind . Debug
240+ )
241+ currentRunWithDebug . getIdeTag . returns ( '--define=ide_client=vscode' )
242+ currentRunWithDebug . getDebugBazelFlags . returns ( [ '--flag1' , '--flag2' ] )
243+
244+ const resultWithDebug = testInfo . prepareTestRunParams ( currentRunWithDebug )
245+ assert . deepStrictEqual ( resultWithDebug , {
246+ arguments : [ ] ,
247+ environmentVariables : { } ,
248+ originId : 'sample' ,
249+ targets : [
250+ {
251+ uri : '//sample/target:test' ,
252+ } ,
253+ ] ,
254+ workingDirectory : '' ,
255+ dataKind : TestParamsDataKind . BazelTest ,
256+ data : {
257+ coverage : false ,
258+ additionalBazelParams : '--flag1 --flag2 --define=ide_client=vscode' ,
259+ } ,
260+ } )
261+ } )
201262 } )
202263
203264 suite ( 'Set display name' , ( ) => {
0 commit comments