File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,12 @@ describe("GetStatisticsCommand()", function () {
3434 assert . ok ( stats . lastDocEtag ) ;
3535 assert . ok ( stats . lastDocEtag > 0 ) ;
3636
37- assert . strictEqual ( stats . countOfIndexes , 3 ) ;
37+ if ( testContext . serverVersion === "4.1" ) {
38+ assert . strictEqual ( stats . countOfIndexes , 3 ) ;
39+ } else {
40+ assert . strictEqual ( stats . countOfIndexes , 4 ) ;
41+ }
42+
3843 assert . strictEqual ( stats . countOfDocuments , 1059 ) ;
3944 assert . ok ( stats . countOfRevisionDocuments > 0 ) ;
4045 assert . strictEqual ( stats . countOfDocumentsConflicts , 0 ) ;
Original file line number Diff line number Diff line change @@ -28,6 +28,12 @@ const log = getLogger({ module: "TestDriver" });
2828
2929export abstract class RavenTestDriver implements IDisposable {
3030
31+ private _serverVersion : string ;
32+
33+ public get serverVersion ( ) {
34+ return this . _serverVersion ;
35+ }
36+
3137 private readonly _locator : RavenServerLocator ;
3238 private readonly _securedLocator : RavenServerLocator ;
3339
@@ -194,6 +200,7 @@ export abstract class RavenTestDriver implements IDisposable {
194200 } ) ;
195201
196202 const scrapServerUrl = ( ) => {
203+ const SERVER_VERSION_REGEX = / V e r s i o n ( 4 .\d ) / ;
197204 const SERVER_URL_REGEX = / S e r v e r a v a i l a b l e o n : \s * ( \S + ) \s * $ / m;
198205 const serverProcess = this . _getGlobalProcess ( secured ) ;
199206 let serverOutput = "" ;
@@ -203,6 +210,12 @@ export abstract class RavenTestDriver implements IDisposable {
203210 serverProcess . stdout
204211 . on ( "data" , ( chunk ) => {
205212 serverOutput += chunk ;
213+
214+ const serverVersionMatch = serverOutput . match ( SERVER_VERSION_REGEX ) ;
215+ if ( serverVersionMatch && serverVersionMatch . length ) {
216+ this . _serverVersion = serverVersionMatch [ 1 ] ;
217+ }
218+
206219 try {
207220 const regexMatch = serverOutput . match ( SERVER_URL_REGEX ) ;
208221 if ( ! regexMatch ) {
You can’t perform that action at this time.
0 commit comments