@@ -617,6 +617,40 @@ testFrameworks.forEach(({
617617 }
618618 )
619619 } )
620+ it ( 'sets _dd.ci.itr.tests_skipped to false if the received suite is not skipped' , ( done ) => {
621+ receiver . setSuitesToSkip ( [ {
622+ type : 'suite' ,
623+ attributes : {
624+ suite : 'ci-visibility/test/not-existing-test.js'
625+ }
626+ } ] )
627+ const eventsPromise = receiver
628+ . gatherPayloadsMaxTimeout ( ( { url } ) => url . endsWith ( '/api/v2/citestcycle' ) , ( payloads ) => {
629+ const events = payloads . flatMap ( ( { payload } ) => payload . events )
630+ const testSession = events . find ( event => event . type === 'test_session_end' ) . content
631+ assert . propertyVal ( testSession . meta , TEST_ITR_TESTS_SKIPPED , 'false' )
632+ assert . propertyVal ( testSession . meta , TEST_CODE_COVERAGE_ENABLED , 'true' )
633+ assert . propertyVal ( testSession . meta , TEST_ITR_SKIPPING_ENABLED , 'true' )
634+ const testModule = events . find ( event => event . type === 'test_module_end' ) . content
635+ assert . propertyVal ( testModule . meta , TEST_ITR_TESTS_SKIPPED , 'false' )
636+ assert . propertyVal ( testModule . meta , TEST_CODE_COVERAGE_ENABLED , 'true' )
637+ assert . propertyVal ( testModule . meta , TEST_ITR_SKIPPING_ENABLED , 'true' )
638+ } , 25000 )
639+
640+ childProcess = exec (
641+ runTestsWithCoverageCommand ,
642+ {
643+ cwd,
644+ env : getCiVisAgentlessConfig ( receiver . port ) ,
645+ stdio : 'inherit'
646+ }
647+ )
648+ childProcess . on ( 'exit' , ( ) => {
649+ eventsPromise . then ( ( ) => {
650+ done ( )
651+ } ) . catch ( done )
652+ } )
653+ } )
620654 } )
621655
622656 describe ( 'evp proxy' , ( ) => {
@@ -921,6 +955,40 @@ testFrameworks.forEach(({
921955 }
922956 )
923957 } )
958+ it ( 'sets _dd.ci.itr.tests_skipped to false if the received suite is not skipped' , ( done ) => {
959+ receiver . setSuitesToSkip ( [ {
960+ type : 'suite' ,
961+ attributes : {
962+ suite : 'ci-visibility/test/not-existing-test.js'
963+ }
964+ } ] )
965+ const eventsPromise = receiver
966+ . gatherPayloadsMaxTimeout ( ( { url } ) => url . endsWith ( '/api/v2/citestcycle' ) , ( payloads ) => {
967+ const events = payloads . flatMap ( ( { payload } ) => payload . events )
968+ const testSession = events . find ( event => event . type === 'test_session_end' ) . content
969+ assert . propertyVal ( testSession . meta , TEST_ITR_TESTS_SKIPPED , 'false' )
970+ assert . propertyVal ( testSession . meta , TEST_CODE_COVERAGE_ENABLED , 'true' )
971+ assert . propertyVal ( testSession . meta , TEST_ITR_SKIPPING_ENABLED , 'true' )
972+ const testModule = events . find ( event => event . type === 'test_module_end' ) . content
973+ assert . propertyVal ( testModule . meta , TEST_ITR_TESTS_SKIPPED , 'false' )
974+ assert . propertyVal ( testModule . meta , TEST_CODE_COVERAGE_ENABLED , 'true' )
975+ assert . propertyVal ( testModule . meta , TEST_ITR_SKIPPING_ENABLED , 'true' )
976+ } , 25000 )
977+
978+ childProcess = exec (
979+ runTestsWithCoverageCommand ,
980+ {
981+ cwd,
982+ env : getCiVisEvpProxyConfig ( receiver . port ) ,
983+ stdio : 'inherit'
984+ }
985+ )
986+ childProcess . on ( 'exit' , ( ) => {
987+ eventsPromise . then ( ( ) => {
988+ done ( )
989+ } ) . catch ( done )
990+ } )
991+ } )
924992 } )
925993 } )
926994} )
0 commit comments