Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: WIP: run e2e legacy-cli tests under bazel
- Loading branch information
Showing
31 changed files
with
2,601 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
load("//tools:defaults.bzl", "ts_library") | ||
|
||
ts_library( | ||
name = "lib", | ||
srcs = ["packages.ts"], | ||
data = [ | ||
"//:.monorepo.json", | ||
], | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//packages/angular_devkit/core", | ||
"@npm//@types/node", | ||
"@npm//typescript", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
load(":cli_integration_test.bzl", "cli_integration_test") | ||
load("//tools:defaults.bzl", "ts_library") | ||
|
||
ts_library( | ||
name = "runner", | ||
testonly = True, | ||
srcs = glob(["**/*.ts"]), | ||
data = [ | ||
"verdaccio.yaml", | ||
"verdaccio_auth.yaml", | ||
"//tests/legacy-cli/e2e/assets", | ||
], | ||
deps = [ | ||
"//packages/angular_devkit/core", | ||
"//packages/angular_devkit/core/node", | ||
"//tests/legacy-cli/e2e/utils", | ||
"@npm//@types/glob", | ||
"@npm//@types/yargs-parser", | ||
"@npm//ansi-colors", | ||
"@npm//yargs-parser", | ||
|
||
# Loaded dynamically at runtime, not compiletime deps | ||
"//tests/legacy-cli/e2e/setup", | ||
"//tests/legacy-cli/e2e/tests", | ||
], | ||
) | ||
|
||
# TODO(bazel): run e2e tests on node14+16, npm+yarn+esbuild | ||
|
||
cli_integration_test( | ||
name = "e2e", | ||
data = [ | ||
# Test runner | ||
":runner", | ||
|
||
# Runtime deps | ||
# TODO: not needed when no longer compiling inline? | ||
"//:.gitignore", | ||
"//:package.json", | ||
"//:tsconfig.json", | ||
|
||
# Runtime deps of everything | ||
# TODO: do this dynamically within cli_integration_test, for now for simplicity | ||
# just put every potential runtime dep. | ||
# | ||
# > cat `find packages/ | grep BUILD` | grep "@npm" | grep -v "@types" | sed -e 's/ //g' | sed -e 's/#.*//g' | sort -u | ||
"@npm//@ampproject/remapping", | ||
"@npm//@angular/animations", | ||
"@npm//@angular/common", | ||
"@npm//@angular/compiler", | ||
"@npm//@angular/compiler-cli", | ||
"@npm//@angular/core", | ||
"@npm//@angular/localize", | ||
"@npm//@angular/material", | ||
"@npm//@angular/platform-browser", | ||
"@npm//@angular/platform-browser-dynamic", | ||
"@npm//@angular/platform-server", | ||
"@npm//@angular/router", | ||
"@npm//@angular/service-worker", | ||
"@npm//@babel/core", | ||
"@npm//@babel/generator", | ||
"@npm//@babel/helper-annotate-as-pure", | ||
"@npm//@babel/plugin-proposal-async-generator-functions", | ||
"@npm//@babel/plugin-transform-async-to-generator", | ||
"@npm//@babel/plugin-transform-runtime", | ||
"@npm//@babel/preset-env", | ||
"@npm//@babel/runtime", | ||
"@npm//@babel/template", | ||
"@npm//@discoveryjs/json-ext", | ||
"@npm//@yarnpkg/lockfile", | ||
"@npm//ajv", | ||
"@npm//ajv-formats", | ||
"@npm//ansi-colors", | ||
"@npm//babel-loader", | ||
"@npm//babel-plugin-istanbul", | ||
"@npm//bootstrap", | ||
"@npm//browserslist", | ||
"@npm//cacache", | ||
"@npm//chokidar", | ||
"@npm//copy-webpack-plugin", | ||
"@npm//critters", | ||
"@npm//css-loader", | ||
"@npm//esbuild", | ||
"@npm//esbuild-wasm", | ||
"@npm//express", | ||
"@npm//font-awesome", | ||
"@npm//glob", | ||
"@npm//http-proxy", | ||
"@npm//https-proxy-agent", | ||
"@npm//ini", | ||
"@npm//inquirer", | ||
"@npm//jasmine", | ||
"@npm//jasmine-spec-reporter", | ||
"@npm//jquery", | ||
"@npm//jsonc-parser", | ||
"@npm//karma", | ||
"@npm//karma-chrome-launcher", | ||
"@npm//karma-coverage", | ||
"@npm//karma-jasmine", | ||
"@npm//karma-jasmine-html-reporter", | ||
"@npm//karma-source-map-support", | ||
"@npm//less", | ||
"@npm//less-loader", | ||
"@npm//license-webpack-plugin", | ||
"@npm//loader-utils", | ||
"@npm//magic-string", | ||
"@npm//mini-css-extract-plugin", | ||
"@npm//minimatch", | ||
"@npm//ng-packagr", | ||
"@npm//node-fetch", | ||
"@npm//npm", | ||
"@npm//npm-package-arg", | ||
"@npm//open", | ||
"@npm//ora", | ||
"@npm//pacote", | ||
"@npm//parse5-html-rewriting-stream", | ||
"@npm//pidtree", | ||
"@npm//pidusage", | ||
"@npm//piscina", | ||
"@npm//popper.js", | ||
"@npm//postcss", | ||
"@npm//postcss-import", | ||
"@npm//postcss-loader", | ||
"@npm//postcss-preset-env", | ||
"@npm//prettier", | ||
"@npm//protractor", | ||
"@npm//puppeteer", | ||
"@npm//regenerator-runtime", | ||
"@npm//resolve-url-loader", | ||
"@npm//rxjs", | ||
"@npm//sass", | ||
"@npm//sass-loader", | ||
"@npm//semver", | ||
"@npm//source-map", | ||
"@npm//source-map-loader", | ||
"@npm//source-map-support", | ||
"@npm//stylus", | ||
"@npm//stylus-loader", | ||
"@npm//symbol-observable", | ||
"@npm//terser", | ||
"@npm//text-table", | ||
"@npm//tree-kill", | ||
"@npm//ts-node", | ||
"@npm//tslib", | ||
"@npm//typescript", | ||
"@npm//webpack", | ||
"@npm//webpack-dev-middleware", | ||
"@npm//webpack-dev-server", | ||
"@npm//webpack-merge", | ||
"@npm//webpack-subresource-integrity", | ||
"@npm//yargs", | ||
"@npm//yargs-parser", | ||
"@npm//yarn", | ||
"@npm//zone.js", | ||
], | ||
entry_point = ":bazel_runner.js", | ||
packages = [ | ||
# bazel query --output=label "kind('pkg_npm', //packages/...)" | ||
"//packages/schematics/angular:npm_package", | ||
"//packages/ngtools/webpack:npm_package", | ||
"//packages/angular_devkit/schematics_cli:npm_package", | ||
"//packages/angular_devkit/schematics:npm_package", | ||
"//packages/angular_devkit/core:npm_package", | ||
"//packages/angular_devkit/build_webpack:npm_package", | ||
"//packages/angular_devkit/build_angular:npm_package", | ||
# this is private so don't use here | ||
# "//packages/angular_devkit/benchmark:npm_package", | ||
"//packages/angular_devkit/architect_cli:npm_package", | ||
"//packages/angular_devkit/architect:npm_package", | ||
"//packages/angular/pwa:npm_package", | ||
"//packages/angular/cli:npm_package", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
import { join } from 'path'; | ||
|
||
import { IS_BAZEL, setPackages } from './e2e/utils/bazel'; | ||
if (!IS_BAZEL) { | ||
throw new Error(`${__filename} must be invoked via bazel`); | ||
} | ||
|
||
// When run via bazel the extra argument is a config file containing an array of test configs. | ||
// Read the config file and metadata about each package. | ||
const packages = require(process.argv[2]).map((pkg: any) => { | ||
// The path relative to this file (relative to the BUILD compiling it); | ||
const pkgPath = pkg.path; | ||
|
||
// require() using relative path | ||
const packageJSON = require(`${pkgPath}/package.json`); | ||
|
||
return { | ||
name: packageJSON.name, | ||
version: packageJSON.version, | ||
path: join(__dirname, pkgPath), | ||
}; | ||
}); | ||
|
||
console.log('BAZEL_PACKAGES: ', packages); | ||
|
||
// Globally persist the packages | ||
setPackages(packages); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('./bazel_e2e_setup'); | ||
require('./e2e_runner'); |
Oops, something went wrong.