@@ -14,6 +14,8 @@ import {
1414 omnisharpTestRootPath ,
1515 testRootPath ,
1616 integrationTestRunnerPath ,
17+ razorIntegrationTestAssetsRootPath ,
18+ razorIntegrationTestRunnerPath ,
1719} from './projectPaths' ;
1820import spawnNode from './spawnNode' ;
1921import * as jest from 'jest' ;
@@ -45,6 +47,16 @@ gulp.task('test:razor', async () => {
4547 runJestTest ( razorTestProjectName ) ;
4648} ) ;
4749
50+ const razorIntegrationTestProjects = [ 'BasicRazorApp2_1' ] ;
51+ for ( const projectName of razorIntegrationTestProjects ) {
52+ gulp . task ( `test:razorintegration:${ projectName } ` , async ( ) => runIntegrationTest ( projectName , /* razor */ true ) ) ;
53+ }
54+
55+ gulp . task (
56+ 'test:razorintegration' ,
57+ gulp . series ( razorIntegrationTestProjects . map ( ( projectName ) => `test:razorintegration:${ projectName } ` ) )
58+ ) ;
59+
4860gulp . task ( 'omnisharptest:unit' , async ( ) => {
4961 const result = await spawnNode ( [
5062 mochaPath ,
@@ -113,7 +125,7 @@ gulp.task(
113125 gulp . series ( integrationTestProjects . map ( ( projectName ) => `test:integration:${ projectName } ` ) )
114126) ;
115127
116- gulp . task ( 'test' , gulp . series ( 'test:unit' , 'test:integration' , 'test:razor' ) ) ;
128+ gulp . task ( 'test' , gulp . series ( 'test:unit' , 'test:integration' , 'test:razor' , 'test:razorintegration' ) ) ;
117129
118130async function runOmnisharpIntegrationTest ( testAssetName : string , engine : 'stdio' | 'lsp' ) {
119131 const workspaceFile = `omnisharp${ engine === 'lsp' ? '_lsp' : '' } _${ testAssetName } .code-workspace` ;
@@ -145,22 +157,23 @@ async function runOmnisharpIntegrationTest(testAssetName: string, engine: 'stdio
145157 return result ;
146158}
147159
148- async function runIntegrationTest ( testAssetName : string ) {
160+ async function runIntegrationTest ( testAssetName : string , razor = false ) {
149161 const workspacePath = path . join (
150- integrationTestAssetsRootPath ,
162+ razor ? razorIntegrationTestAssetsRootPath : integrationTestAssetsRootPath ,
151163 testAssetName ,
152164 '.vscode' ,
153165 `lsp_tools_host_${ testAssetName } .code-workspace`
154166 ) ;
155- const codeTestsPath = path . join ( testRootPath , 'integrationTests' ) ;
167+ const codeTestsPath = path . join ( testRootPath , razor ? 'razorIntegrationTests' : 'integrationTests' ) ;
156168
157169 const env = {
158170 CODE_TESTS_WORKSPACE : workspacePath ,
159171 CODE_EXTENSIONS_PATH : rootPath ,
160172 EXTENSIONS_TESTS_PATH : path . join ( codeTestsPath , 'index.js' ) ,
161173 } ;
162174
163- const result = await spawnNode ( [ integrationTestRunnerPath , '--enable-source-maps' ] , { env, cwd : rootPath } ) ;
175+ const runnerPath = razor ? razorIntegrationTestRunnerPath : integrationTestRunnerPath ;
176+ const result = await spawnNode ( [ runnerPath , '--enable-source-maps' ] , { env, cwd : rootPath } ) ;
164177
165178 if ( result . code === null || result . code > 0 ) {
166179 // Ensure that gulp fails when tests fail
0 commit comments