Skip to content

ci: trim appveyor test suite #6551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ install:
test_script:
- node --version
- yarn --version
- yarn test
- node tests\run_e2e.js
- node tests\run_e2e.js --appveyor

build: off

cache:
- node_modules
- "%LOCALAPPDATA%/Yarn"
- "%LOCALAPPDATA%/Yarn"
6 changes: 6 additions & 0 deletions tests/e2e/tests/build/base-href.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import {ng} from '../../utils/process';
import {expectFileToMatch} from '../../utils/fs';
import {getGlobalVariable} from '../../utils/env';


export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return ng('build', '--base-href', '/myUrl')
.then(() => expectFileToMatch('dist/index.html', /<base href="\/myUrl">/));
}
7 changes: 7 additions & 0 deletions tests/e2e/tests/build/chunk-hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as fs from 'fs';
import {ng} from '../../utils/process';
import {writeFile} from '../../utils/fs';
import {addImportToModule} from '../../utils/ast';
import {getGlobalVariable} from '../../utils/env';

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

Expand Down Expand Up @@ -44,6 +45,12 @@ function validateHashes(
}

export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}


let oldHashes: Map<string, string>;
let newHashes: Map<string, string>;
// First, collect the hashes.
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/build/css-urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
writeMultipleFiles
} from '../../utils/fs';
import { expectToFail } from '../../utils/utils';
import { getGlobalVariable } from '../../utils/env';

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

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
// Verify absolute/relative paths in global/component css.
.then(() => writeMultipleFiles({
Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/tests/build/delete-output-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import {deleteFile, expectFileToExist} from '../../utils/fs';
import {getGlobalVariable} from '../../utils/env';

export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

// Skip this in ejected tests.
if (getGlobalVariable('argv').eject) {
return Promise.resolve();
Expand Down
7 changes: 7 additions & 0 deletions tests/e2e/tests/build/deploy-url.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
import { ng } from '../../utils/process';
import { expectFileToMatch, writeMultipleFiles } from '../../utils/fs';
import { updateJsonFile } from '../../utils/project';
import { getGlobalVariable } from '../../utils/env';
import { stripIndents } from 'common-tags';


export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}


return Promise.resolve()
.then(() => writeMultipleFiles({
'src/styles.css': 'div { background: url("./assets/more.svg"); }',
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/build/filename.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ import {ng} from '../../utils/process';
import {expectFileToExist} from '../../utils/fs';
import {updateJsonFile} from '../../utils/project';
import {copyFile} from '../../utils/fs';
import {getGlobalVariable} from '../../utils/env';


export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => copyFile('src/index.html', 'src/config-index.html'))
.then(() => updateJsonFile('.angular-cli.json', configJson => {
Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/tests/build/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import {getGlobalVariable} from '../../utils/env';


export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

// Skip this in ejected tests.
if (getGlobalVariable('argv').eject) {
return Promise.resolve();
Expand Down
8 changes: 7 additions & 1 deletion tests/e2e/tests/build/module-id.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { ng } from '../../utils/process';
import { replaceInFile } from "../../utils/fs";
import { replaceInFile } from '../../utils/fs';
import { getGlobalVariable } from '../../utils/env';


export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => replaceInFile('src/app/app.component.ts',
'@Component({',
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/build/no-implicit-any.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import {updateTsConfig} from '../../utils/project';
import {ng} from '../../utils/process';
import {getGlobalVariable} from '../../utils/env';


export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return updateTsConfig(json => {
json['compilerOptions']['noImplicitAny'] = true;
})
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/build/output-hashing.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
import {stripIndents} from 'common-tags';
import {ng} from '../../utils/process';
import { writeMultipleFiles, expectFileToMatch, expectFileMatchToExist } from '../../utils/fs';
import { getGlobalVariable } from '../../utils/env';

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

export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => writeMultipleFiles({
'src/styles.css': stripIndents`
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/build/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { expectFileToMatch } from '../../utils/fs';
import { ng } from '../../utils/process';
import { getGlobalVariable } from '../../utils/env';
import { oneLineTrim } from 'common-tags';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => ng('build'))
// files were created successfully
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/build/sourcemap.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import {ng} from '../../utils/process';
import {expectFileToExist} from '../../utils/fs';
import {expectToFail} from '../../utils/utils';
import {getGlobalVariable} from '../../utils/env';


export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return ng('build')
.then(() => expectFileToExist('dist/main.bundle.js.map'))

Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/build/styles/extract-css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ import {
import { ng } from '../../../utils/process';
import { updateJsonFile } from '../../../utils/project';
import { expectToFail } from '../../../utils/utils';
import { getGlobalVariable } from '../../../utils/env';
import { oneLineTrim } from 'common-tags';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => writeMultipleFiles({
'src/string-style.css': '.string-style { color: red }',
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/build/styles/postcss.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import * as glob from 'glob';
import { writeFile, expectFileToMatch } from '../../../utils/fs';
import { ng } from '../../../utils/process';
import { getGlobalVariable } from '../../../utils/env';
import { stripIndents } from 'common-tags';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return writeFile('src/styles.css', stripIndents`
/* normal-comment */
/*! important-comment */
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/commands/new/new-routing.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import {ng} from '../../../utils/process';
import {createProject} from '../../../utils/project';
import { getGlobalVariable } from '../../../utils/env';


export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => createProject('routing-project', '--routing'))

Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/commands/new/new-skip-commit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ import {ng} from '../../../utils/process';
import {createProject} from '../../../utils/project';
import {expectToFail} from '../../../utils/utils';
import {expectGitToBeClean} from '../../../utils/git';
import {getGlobalVariable} from '../../../utils/env';


export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => createProject('new-project', '--skip-commit'))
.then(() => expectToFail(() => expectGitToBeClean()))
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/commands/new/new-skip-tests.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import {createProject} from '../../../utils/project';
import {expectFileNotToExist} from '../../../utils/fs';
import {getGlobalVariable} from '../../../utils/env';


export default function() {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => createProject('new-project-skip-tests', '--skip-tests'))
.then(() => expectFileNotToExist('src/app/app.component.spec.ts'));
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/lint/lint-no-config-section.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { ng } from '../../utils/process';
import { getGlobalVariable } from '../../utils/env';
import { oneLine } from 'common-tags';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => ng('set', 'lint', '[]'))
.then(() => ng('lint'))
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/lint/lint-no-project.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { ng } from '../../utils/process';
import { writeFile } from '../../utils/fs';
import { expectToFail } from '../../utils/utils';
import { getGlobalVariable } from '../../utils/env';
import { oneLine } from 'common-tags';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

return Promise.resolve()
.then(() => ng('set', 'lint.0.project', ''))
.then(() => ng('lint', '--type-check'))
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/lint/lint-with-exclude.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { ng } from '../../utils/process';
import { writeFile } from '../../utils/fs';
import { getGlobalVariable } from '../../utils/env';
import { oneLine } from 'common-tags';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

const fileName = 'src/app/foo.ts';

return Promise.resolve()
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/lint/lint-with-force.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { ng } from '../../utils/process';
import { writeFile } from '../../utils/fs';
import { getGlobalVariable } from '../../utils/env';
import { oneLine } from 'common-tags';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

const fileName = 'src/app/foo.ts';

return Promise.resolve()
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/lint/lint-with-format.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { ng } from '../../utils/process';
import { writeFile } from '../../utils/fs';
import { getGlobalVariable } from '../../utils/env';
import { oneLine } from 'common-tags';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

const fileName = 'src/app/foo.ts';

return Promise.resolve()
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/lint/lint-with-nested-configs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { createDir, writeFile } from '../../utils/fs';
import { ng } from '../../utils/process';
import { expectToFail } from '../../utils/utils';
import { getGlobalVariable } from '../../utils/env';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

const fileName = 'src/app/foo/foo.ts';
const nestedConfigContent = `
{
Expand Down
6 changes: 6 additions & 0 deletions tests/e2e/tests/lint/lint-with-type-check-fail.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { ng } from '../../utils/process';
import { expectToFail } from '../../utils/utils';
import { writeFile } from '../../utils/fs';
import { getGlobalVariable } from '../../utils/env';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

const fileName = 'src/app/foo.ts';
const fileContents = `
const ANIMATION_CSS_VALUE_REGEX = 'asda';
Expand Down
Loading