Skip to content
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

Disable ng_package test temporarily #22933

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -40,6 +40,7 @@
"@types/angularjs": "1.5.14-alpha",
"@types/base64-js": "1.2.5",
"@types/chokidar": "1.7.3",
"@types/diff": "^3.2.2",
"@types/fs-extra": "4.0.2",
"@types/hammerjs": "2.0.35",
"@types/jasmine": "2.2.22-alpha",
Expand All @@ -64,6 +65,7 @@
"cldrjs": "0.5.0",
"conventional-changelog": "1.1.0",
"cors": "2.8.4",
"diff": "^3.5.0",
"domino": "2.0.1",
"entities": "1.1.1",
"firebase-tools": "3.12.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/bazel/test/ng_package/BUILD.bazel
Expand Up @@ -48,6 +48,8 @@ jasmine_node_test(
"example_package.golden",
"//packages/bazel/test/ng_package/example:npm_package",
],
# TODO(alexeagle): re-enable this test
tags = ["manual"],
)

nodejs_binary(
Expand Down
14 changes: 12 additions & 2 deletions packages/bazel/test/ng_package/example_package.spec.ts
Expand Up @@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {createPatch} from 'diff';
import * as fs from 'fs';
import * as path from 'path';

Expand Down Expand Up @@ -49,11 +50,20 @@ if (require.main === module) {
if (actual === expected) {
return;
}

// Compute the patch and strip the header
let patch =
createPatch(goldenFile, expected, actual, 'Golden file', 'Generated file', {context: 5});
const endOfHeader = patch.indexOf('\n', patch.indexOf('\n') + 1) + 1;
patch = patch.substring(endOfHeader);

fail(`example ng_package differs from golden file

Diff:
${patch}

Accept the new golden file:
bazel run ${process.env['BAZEL_TARGET']}.accept
`);
`);
});
});
}
8 changes: 8 additions & 0 deletions yarn.lock
Expand Up @@ -91,6 +91,10 @@
dependencies:
"@types/node" "*"

"@types/diff@^3.2.2":
version "3.2.2"
resolved "https://registry.yarnpkg.com/@types/diff/-/diff-3.2.2.tgz#4d6f45537322a7a420d353a0939513c7e96d14a6"

"@types/events@*":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@types/events/-/events-1.1.0.tgz#93b1be91f63c184450385272c47b6496fd028e02"
Expand Down Expand Up @@ -1959,6 +1963,10 @@ diff@^3.2.0:
version "3.3.1"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75"

diff@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"

doctrine@^0.7.2:
version "0.7.2"
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-0.7.2.tgz#7cb860359ba3be90e040b26b729ce4bfa654c523"
Expand Down