Skip to content

Commit

Permalink
Disable lang server tests for now
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenWeatherford committed Aug 23, 2019
1 parent d8e13d1 commit d31ea2d
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .azure-pipelines/common/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ steps:
SERVICE_PRINCIPAL_SECRET: $(SERVICE_PRINCIPAL_SECRET)
SERVICE_PRINCIPAL_DOMAIN: $(SERVICE_PRINCIPAL_DOMAIN)
DISPLAY: :10 # Only necessary for linux tests
DISABLE_LANGUAGE_SERVER_TESTS: "true" # TODO: remove

- task: PublishTestResults@2
displayName: 'Publish Test Results'
Expand Down
5 changes: 5 additions & 0 deletions test/formatDocument.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ import { armDeploymentLanguageId } from "../extension.bundle";
import { diagnosticsTimeout, testFolder } from "./support/diagnostics";
import { ensureLanguageServerAvailable } from "./support/ensureLanguageServerAvailable";
import { getTempFilePath } from "./support/getTempFilePath";
import { DISABLE_LANGUAGE_SERVER_TESTS } from "./testConstants";

const formatDocumentCommand = 'editor.action.formatDocument';
const formatRangeCommand = 'editor.action.formatSelection';

suite("Format document", function (this: ISuiteCallbackContext): void {
this.timeout(diagnosticsTimeout);

if (DISABLE_LANGUAGE_SERVER_TESTS) {
return;
}

function testFormat(testName: string, source: string, expected: string, range?: Range | RegExp): void {
test(testName, async () => {
await ensureLanguageServerAvailable();
Expand Down
5 changes: 5 additions & 0 deletions test/functional/expressions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
// tslint:disable:no-unused-expression max-func-body-length promise-function-async max-line-length no-http-string no-suspicious-comment

import { IDeploymentParameterDefinition, IDeploymentTemplate, sources, testDiagnostics } from "../support/diagnostics";
import { DISABLE_LANGUAGE_SERVER_TESTS } from "../testConstants";

// Note: a lot of these come from TLE.test.ts, but this version goes through the vscode diagnostics and thus tests the language server
suite("Expressions functional tests", () => {
if (DISABLE_LANGUAGE_SERVER_TESTS) {
return;
}

// testName defaults to expression if left blank
function testExpression(testName: string, expression: string, expected: string[]): void {
test(testName || expression, async () => {
Expand Down
5 changes: 5 additions & 0 deletions test/functional/validation.acceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
// tslint:disable:no-suspicious-comment

import { minimalDeploymentTemplate, testDiagnostics, testDiagnosticsFromFile } from "../support/diagnostics";
import { DISABLE_LANGUAGE_SERVER_TESTS } from "../testConstants";

suite("Acceptance validation tests (all sources)", () => {
if (DISABLE_LANGUAGE_SERVER_TESTS) {
return;
}

test("minimal deployment template - no errors", async () => {
await testDiagnostics(
minimalDeploymentTemplate,
Expand Down
5 changes: 5 additions & 0 deletions test/functional/validation.backend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
// tslint:disable:object-literal-key-quotes no-http-string

import { sources, testDiagnostics } from "../support/diagnostics";
import { DISABLE_LANGUAGE_SERVER_TESTS } from "../testConstants";

suite("Backend validation", () => {
if (DISABLE_LANGUAGE_SERVER_TESTS) {
return;
}

// tslint:disable-next-line: no-suspicious-comment
test("missing required property 'resources'", async () =>
await testDiagnostics(
Expand Down
5 changes: 5 additions & 0 deletions test/functional/validation.expressions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
// tslint:disable:no-suspicious-comment

import { sources, testDiagnosticsFromFile } from "../support/diagnostics";
import { DISABLE_LANGUAGE_SERVER_TESTS } from "../testConstants";

suite("Expression validation", () => {
if (DISABLE_LANGUAGE_SERVER_TESTS) {
return;
}

test(
'templates/new-vm.jsonc',
async () =>
Expand Down
5 changes: 5 additions & 0 deletions test/functional/validation.json.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { sources, testDiagnostics } from "../support/diagnostics";
import { DISABLE_LANGUAGE_SERVER_TESTS } from "../testConstants";

// ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------

suite("JSON validation", () => {
if (DISABLE_LANGUAGE_SERVER_TESTS) {
return;
}

test("no closing brace", async () =>
await testDiagnostics(
`{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
Expand Down
5 changes: 5 additions & 0 deletions test/functional/validation.schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
// tslint:disable:object-literal-key-quotes no-http-string max-func-body-length

import { sources, testDiagnostics, testDiagnosticsFromFile } from "../support/diagnostics";
import { DISABLE_LANGUAGE_SERVER_TESTS } from "../testConstants";

suite("Schema validation", () => {
if (DISABLE_LANGUAGE_SERVER_TESTS) {
return;
}

test("missing required property 'resources'", async () =>
await testDiagnostics(
{
Expand Down
9 changes: 9 additions & 0 deletions test/testConstants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

// tslint:disable-next-line: no-suspicious-comment
// TODO: Remove when language server available for build
// tslint:disable-next-line: strict-boolean-expressions export-name
export const DISABLE_LANGUAGE_SERVER_TESTS: boolean = /^(true|1)?$/i.test(process.env.DISABLE_LANGUAGE_SERVER_TESTS || '');

0 comments on commit d31ea2d

Please sign in to comment.