Addresses comments on #266
This commit is contained in:
@@ -68,7 +68,7 @@ export class CompletedQuery implements QueryWithResults {
|
||||
return `timed out after ${this.result.evaluationTime / 1000} seconds`;
|
||||
case messages.QueryResultType.OTHER_ERROR:
|
||||
default:
|
||||
return `failed: ${this.result.message || ''}`;
|
||||
return this.result.message ? `failed: ${this.result.message}` : 'failed';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -423,7 +423,7 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
errors = await query.compile(qs);
|
||||
} catch (e) {
|
||||
if (e instanceof ResponseError && e.code == ErrorCodes.RequestCancelled) {
|
||||
return createSyntheticResult(query, db, historyItemOptions, 'Query cancelled');
|
||||
return createSyntheticResult(query, db, historyItemOptions, 'Query cancelled', messages.QueryResultType.CANCELLATION);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
@@ -469,7 +469,7 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
" and choose CodeQL Query Server from the dropdown.");
|
||||
}
|
||||
|
||||
return createSyntheticResult(query, db, historyItemOptions, 'Query had compilation errors');
|
||||
return createSyntheticResult(query, db, historyItemOptions, 'Query had compilation errors', messages.QueryResultType.OTHER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,14 +477,15 @@ function createSyntheticResult(
|
||||
query: QueryInfo,
|
||||
db: DatabaseItem,
|
||||
historyItemOptions: QueryHistoryItemOptions,
|
||||
message: string
|
||||
message: string,
|
||||
resultType: number
|
||||
) {
|
||||
|
||||
return {
|
||||
query,
|
||||
result: {
|
||||
evaluationTime: 0,
|
||||
resultType: messages.QueryResultType.CANCELLATION,
|
||||
resultType: resultType,
|
||||
queryId: -1,
|
||||
runId: -1,
|
||||
message
|
||||
|
||||
@@ -58,4 +58,4 @@ export function runTestsInDirectory(testsRoot: string): Promise<void> {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,4 @@ describe('launching with a minimal workspace', async () => {
|
||||
assert(ext!.isActive);
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { runTestsInDirectory } from '../index-template';
|
||||
export function run(): Promise<void> {
|
||||
return runTestsInDirectory(__dirname);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,4 +10,4 @@ describe('launching with no specified workspace', () => {
|
||||
it('should not activate the extension at first', () => {
|
||||
assert(ext!.isActive === false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { runTestsInDirectory } from '../index-template';
|
||||
export function run(): Promise<void> {
|
||||
return runTestsInDirectory(__dirname);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user