Skip to content

Commit beb7514

Browse files
committed
ci: trim appveyor test suite
1 parent 5f4c87a commit beb7514

40 files changed

+236
-9
lines changed

.appveyor.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ install:
1212
test_script:
1313
- node --version
1414
- yarn --version
15-
- yarn test
16-
- node tests\run_e2e.js
15+
- node tests\run_e2e.js --appveyor
1716

1817
build: off
1918

2019
cache:
2120
- node_modules
22-
- "%LOCALAPPDATA%/Yarn"
21+
- "%LOCALAPPDATA%/Yarn"

tests/e2e/tests/build/base-href.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import {ng} from '../../utils/process';
22
import {expectFileToMatch} from '../../utils/fs';
3+
import {getGlobalVariable} from '../../utils/env';
34

45

56
export default function() {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
return ng('build', '--base-href', '/myUrl')
713
.then(() => expectFileToMatch('dist/index.html', /<base href="\/myUrl">/));
814
}

tests/e2e/tests/build/chunk-hash.ts

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import * as fs from 'fs';
44
import {ng} from '../../utils/process';
55
import {writeFile} from '../../utils/fs';
66
import {addImportToModule} from '../../utils/ast';
7+
import {getGlobalVariable} from '../../utils/env';
78

89
const OUTPUT_RE = /(main|polyfills|vendor|inline|styles|\d+)\.[a-z0-9]+\.(chunk|bundle)\.(js|css)$/;
910

@@ -44,6 +45,12 @@ function validateHashes(
4445
}
4546

4647
export default function() {
48+
// Skip this in Appveyor tests.
49+
if (getGlobalVariable('argv').appveyor) {
50+
return Promise.resolve();
51+
}
52+
53+
4754
let oldHashes: Map<string, string>;
4855
let newHashes: Map<string, string>;
4956
// First, collect the hashes.

tests/e2e/tests/build/css-urls.ts

+6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
writeMultipleFiles
88
} from '../../utils/fs';
99
import { expectToFail } from '../../utils/utils';
10+
import { getGlobalVariable } from '../../utils/env';
1011

1112
const imgSvg = `
1213
<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
@@ -15,6 +16,11 @@ const imgSvg = `
1516
`;
1617

1718
export default function () {
19+
// Skip this in Appveyor tests.
20+
if (getGlobalVariable('argv').appveyor) {
21+
return Promise.resolve();
22+
}
23+
1824
return Promise.resolve()
1925
// Verify absolute/relative paths in global/component css.
2026
.then(() => writeMultipleFiles({

tests/e2e/tests/build/delete-output-path.ts

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import {deleteFile, expectFileToExist} from '../../utils/fs';
44
import {getGlobalVariable} from '../../utils/env';
55

66
export default function() {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
712
// Skip this in ejected tests.
813
if (getGlobalVariable('argv').eject) {
914
return Promise.resolve();

tests/e2e/tests/build/deploy-url.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import { ng } from '../../utils/process';
22
import { expectFileToMatch, writeMultipleFiles } from '../../utils/fs';
33
import { updateJsonFile } from '../../utils/project';
4+
import { getGlobalVariable } from '../../utils/env';
45
import { stripIndents } from 'common-tags';
56

67

78
export default function () {
9+
// Skip this in Appveyor tests.
10+
if (getGlobalVariable('argv').appveyor) {
11+
return Promise.resolve();
12+
}
13+
14+
815
return Promise.resolve()
916
.then(() => writeMultipleFiles({
1017
'src/styles.css': 'div { background: url("./assets/more.svg"); }',

tests/e2e/tests/build/filename.ts

+6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import {ng} from '../../utils/process';
22
import {expectFileToExist} from '../../utils/fs';
33
import {updateJsonFile} from '../../utils/project';
44
import {copyFile} from '../../utils/fs';
5+
import {getGlobalVariable} from '../../utils/env';
56

67

78
export default function() {
9+
// Skip this in Appveyor tests.
10+
if (getGlobalVariable('argv').appveyor) {
11+
return Promise.resolve();
12+
}
13+
814
return Promise.resolve()
915
.then(() => copyFile('src/index.html', 'src/config-index.html'))
1016
.then(() => updateJsonFile('.angular-cli.json', configJson => {

tests/e2e/tests/build/json.ts

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ import {getGlobalVariable} from '../../utils/env';
55

66

77
export default function() {
8+
// Skip this in Appveyor tests.
9+
if (getGlobalVariable('argv').appveyor) {
10+
return Promise.resolve();
11+
}
12+
813
// Skip this in ejected tests.
914
if (getGlobalVariable('argv').eject) {
1015
return Promise.resolve();

tests/e2e/tests/build/module-id.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { ng } from '../../utils/process';
2-
import { replaceInFile } from "../../utils/fs";
2+
import { replaceInFile } from '../../utils/fs';
3+
import { getGlobalVariable } from '../../utils/env';
34

45

56
export default function() {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
return Promise.resolve()
713
.then(() => replaceInFile('src/app/app.component.ts',
814
'@Component({',

tests/e2e/tests/build/no-implicit-any.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import {updateTsConfig} from '../../utils/project';
22
import {ng} from '../../utils/process';
3+
import {getGlobalVariable} from '../../utils/env';
34

45

56
export default function() {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
return updateTsConfig(json => {
713
json['compilerOptions']['noImplicitAny'] = true;
814
})

tests/e2e/tests/build/output-hashing.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import {stripIndents} from 'common-tags';
22
import {ng} from '../../utils/process';
33
import { writeMultipleFiles, expectFileToMatch, expectFileMatchToExist } from '../../utils/fs';
4+
import { getGlobalVariable } from '../../utils/env';
45

56
function verifyMedia(css: RegExp, content: RegExp) {
67
return expectFileMatchToExist('./dist', css)
78
.then(fileName => expectFileToMatch(`dist/${fileName}`, content));
89
}
910

1011
export default function() {
12+
// Skip this in Appveyor tests.
13+
if (getGlobalVariable('argv').appveyor) {
14+
return Promise.resolve();
15+
}
16+
1117
return Promise.resolve()
1218
.then(() => writeMultipleFiles({
1319
'src/styles.css': stripIndents`

tests/e2e/tests/build/polyfills.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { expectFileToMatch } from '../../utils/fs';
22
import { ng } from '../../utils/process';
3+
import { getGlobalVariable } from '../../utils/env';
34
import { oneLineTrim } from 'common-tags';
45

56
export default function () {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
return Promise.resolve()
713
.then(() => ng('build'))
814
// files were created successfully

tests/e2e/tests/build/sourcemap.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import {ng} from '../../utils/process';
22
import {expectFileToExist} from '../../utils/fs';
33
import {expectToFail} from '../../utils/utils';
4+
import {getGlobalVariable} from '../../utils/env';
45

56

67
export default function() {
8+
// Skip this in Appveyor tests.
9+
if (getGlobalVariable('argv').appveyor) {
10+
return Promise.resolve();
11+
}
12+
713
return ng('build')
814
.then(() => expectFileToExist('dist/main.bundle.js.map'))
915

tests/e2e/tests/build/styles/extract-css.ts

+6
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ import {
66
import { ng } from '../../../utils/process';
77
import { updateJsonFile } from '../../../utils/project';
88
import { expectToFail } from '../../../utils/utils';
9+
import { getGlobalVariable } from '../../../utils/env';
910
import { oneLineTrim } from 'common-tags';
1011

1112
export default function () {
13+
// Skip this in Appveyor tests.
14+
if (getGlobalVariable('argv').appveyor) {
15+
return Promise.resolve();
16+
}
17+
1218
return Promise.resolve()
1319
.then(() => writeMultipleFiles({
1420
'src/string-style.css': '.string-style { color: red }',

tests/e2e/tests/build/styles/postcss.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import * as glob from 'glob';
22
import { writeFile, expectFileToMatch } from '../../../utils/fs';
33
import { ng } from '../../../utils/process';
4+
import { getGlobalVariable } from '../../../utils/env';
45
import { stripIndents } from 'common-tags';
56

67
export default function () {
8+
// Skip this in Appveyor tests.
9+
if (getGlobalVariable('argv').appveyor) {
10+
return Promise.resolve();
11+
}
12+
713
return writeFile('src/styles.css', stripIndents`
814
/* normal-comment */
915
/*! important-comment */

tests/e2e/tests/commands/new/new-routing.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import {ng} from '../../../utils/process';
22
import {createProject} from '../../../utils/project';
3+
import { getGlobalVariable } from '../../../utils/env';
34

45

56
export default function() {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
return Promise.resolve()
713
.then(() => createProject('routing-project', '--routing'))
814

tests/e2e/tests/commands/new/new-skip-commit.ts

+6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ import {ng} from '../../../utils/process';
22
import {createProject} from '../../../utils/project';
33
import {expectToFail} from '../../../utils/utils';
44
import {expectGitToBeClean} from '../../../utils/git';
5+
import {getGlobalVariable} from '../../../utils/env';
56

67

78
export default function() {
9+
// Skip this in Appveyor tests.
10+
if (getGlobalVariable('argv').appveyor) {
11+
return Promise.resolve();
12+
}
13+
814
return Promise.resolve()
915
.then(() => createProject('new-project', '--skip-commit'))
1016
.then(() => expectToFail(() => expectGitToBeClean()))

tests/e2e/tests/commands/new/new-skip-tests.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import {createProject} from '../../../utils/project';
22
import {expectFileNotToExist} from '../../../utils/fs';
3+
import {getGlobalVariable} from '../../../utils/env';
34

45

56
export default function() {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
return Promise.resolve()
713
.then(() => createProject('new-project-skip-tests', '--skip-tests'))
814
.then(() => expectFileNotToExist('src/app/app.component.spec.ts'));

tests/e2e/tests/lint/lint-no-config-section.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { ng } from '../../utils/process';
2+
import { getGlobalVariable } from '../../utils/env';
23
import { oneLine } from 'common-tags';
34

45
export default function () {
6+
// Skip this in Appveyor tests.
7+
if (getGlobalVariable('argv').appveyor) {
8+
return Promise.resolve();
9+
}
10+
511
return Promise.resolve()
612
.then(() => ng('set', 'lint', '[]'))
713
.then(() => ng('lint'))

tests/e2e/tests/lint/lint-no-project.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import { ng } from '../../utils/process';
22
import { writeFile } from '../../utils/fs';
33
import { expectToFail } from '../../utils/utils';
4+
import { getGlobalVariable } from '../../utils/env';
45
import { oneLine } from 'common-tags';
56

67
export default function () {
8+
// Skip this in Appveyor tests.
9+
if (getGlobalVariable('argv').appveyor) {
10+
return Promise.resolve();
11+
}
12+
713
return Promise.resolve()
814
.then(() => ng('set', 'lint.0.project', ''))
915
.then(() => ng('lint', '--type-check'))

tests/e2e/tests/lint/lint-with-exclude.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { ng } from '../../utils/process';
22
import { writeFile } from '../../utils/fs';
3+
import { getGlobalVariable } from '../../utils/env';
34
import { oneLine } from 'common-tags';
45

56
export default function () {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
const fileName = 'src/app/foo.ts';
713

814
return Promise.resolve()

tests/e2e/tests/lint/lint-with-force.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { ng } from '../../utils/process';
22
import { writeFile } from '../../utils/fs';
3+
import { getGlobalVariable } from '../../utils/env';
34
import { oneLine } from 'common-tags';
45

56
export default function () {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
const fileName = 'src/app/foo.ts';
713

814
return Promise.resolve()

tests/e2e/tests/lint/lint-with-format.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { ng } from '../../utils/process';
22
import { writeFile } from '../../utils/fs';
3+
import { getGlobalVariable } from '../../utils/env';
34
import { oneLine } from 'common-tags';
45

56
export default function () {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
const fileName = 'src/app/foo.ts';
713

814
return Promise.resolve()

tests/e2e/tests/lint/lint-with-nested-configs.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { createDir, writeFile } from '../../utils/fs';
22
import { ng } from '../../utils/process';
33
import { expectToFail } from '../../utils/utils';
4+
import { getGlobalVariable } from '../../utils/env';
45

56
export default function () {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
const fileName = 'src/app/foo/foo.ts';
713
const nestedConfigContent = `
814
{

tests/e2e/tests/lint/lint-with-type-check-fail.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import { ng } from '../../utils/process';
22
import { expectToFail } from '../../utils/utils';
33
import { writeFile } from '../../utils/fs';
4+
import { getGlobalVariable } from '../../utils/env';
45

56
export default function () {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
612
const fileName = 'src/app/foo.ts';
713
const fileContents = `
814
const ANIMATION_CSS_VALUE_REGEX = 'asda';

0 commit comments

Comments
 (0)