diff --git a/.circleci/config.yml b/.circleci/config.yml index d1bc7c3758..3a45e7f024 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -176,7 +176,7 @@ jobs: # TODO(gmagolan): move these tests into `build` job once # https://github.com/bazelbuild/bazel/issues/6481 is resolved - run: bazel test @examples_program//... - - run: bazel test @packages_example//... + - run: bazel test @internal_e2e_packages//... build_release: <<: *job_defaults diff --git a/WORKSPACE b/WORKSPACE index 54f412826f..dafd35b273 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -34,7 +34,7 @@ local_repository( ) local_repository( - name = "packages_example", + name = "internal_e2e_packages", path = "internal/e2e/packages", ) @@ -91,9 +91,9 @@ load("@npm//:install_bazel_dependencies.bzl", "install_bazel_dependencies") install_bazel_dependencies() -load("@packages_example//:setup_workspace.bzl", "packages_example_setup_workspace") +load("@internal_e2e_packages//:setup_workspace.bzl", "internal_e2e_packages_setup_workspace") -packages_example_setup_workspace() +internal_e2e_packages_setup_workspace() # Dependencies to run skydoc load("@io_bazel_rules_sass//sass:sass_repositories.bzl", "sass_repositories") diff --git a/internal/e2e/packages/BUILD.bazel b/internal/e2e/packages/BUILD.bazel index 5a403ac0de..6ac5463921 100644 --- a/internal/e2e/packages/BUILD.bazel +++ b/internal/e2e/packages/BUILD.bazel @@ -16,20 +16,20 @@ VARIANTS = [ [jasmine_node_test( name = "version_" + variant + "_test", srcs = [variant + ".spec.js"], - node_modules = "@packages_example_" + variant + "//:node_modules", + node_modules = "@internal_e2e_packages_" + variant + "//:node_modules", deps = [":test_version"], ) for variant in VARIANTS] jasmine_node_test( name = "npm_determinism_test", srcs = ["npm_determinism.spec.js"], - data = ["@packages_example_npm_install//node_modules/jsesc:package.json"], - node_modules = "@packages_example_npm_install_duplicate_for_determinism_testing//:node_modules", + data = ["@internal_e2e_packages_npm_install//node_modules/jsesc:package.json"], + node_modules = "@internal_e2e_packages_npm_install_duplicate_for_determinism_testing//:node_modules", ) jasmine_node_test( name = "yarn_determinism_test", srcs = ["yarn_determinism.spec.js"], - data = ["@packages_example_yarn_install//node_modules/jsesc:package.json"], - node_modules = "@packages_example_yarn_install_duplicate_for_determinism_testing//:node_modules", + data = ["@internal_e2e_packages_yarn_install//node_modules/jsesc:package.json"], + node_modules = "@internal_e2e_packages_yarn_install_duplicate_for_determinism_testing//:node_modules", ) diff --git a/internal/e2e/packages/WORKSPACE b/internal/e2e/packages/WORKSPACE index 3af46a4bdf..4b572fd07f 100644 --- a/internal/e2e/packages/WORKSPACE +++ b/internal/e2e/packages/WORKSPACE @@ -1,4 +1,4 @@ -workspace(name = "packages_example") +workspace(name = "internal_e2e_packages") local_repository( name = "build_bazel_rules_nodejs", @@ -10,8 +10,8 @@ load("@build_bazel_rules_nodejs//:defs.bzl", "check_rules_nodejs_version", "node # Test that check_rules_nodejs_version works as expected check_rules_nodejs_version(minimum_version_string = "0.11.2") -node_repositories(package_json = ["//:package.json"]) +node_repositories() -load(":setup_workspace.bzl", "packages_example_setup_workspace") +load(":setup_workspace.bzl", "internal_e2e_packages_setup_workspace") -packages_example_setup_workspace() +internal_e2e_packages_setup_workspace() diff --git a/internal/e2e/packages/package-lock.json b/internal/e2e/packages/npm1/package-lock.json similarity index 100% rename from internal/e2e/packages/package-lock.json rename to internal/e2e/packages/npm1/package-lock.json diff --git a/internal/e2e/packages/npm1/package.json b/internal/e2e/packages/npm1/package.json new file mode 100644 index 0000000000..5bff01fd1d --- /dev/null +++ b/internal/e2e/packages/npm1/package.json @@ -0,0 +1,10 @@ +{ + "description": "runtime dependencies for packages example", + "dependencies": { + "jsesc": "~1.2.0", + "jasmine": "2.8.0" + }, + "scripts": { + "postinstall": "node ./postinstall.js" + } +} diff --git a/internal/e2e/packages/npm2/package-lock.json b/internal/e2e/packages/npm2/package-lock.json new file mode 100644 index 0000000000..d08e1b528b --- /dev/null +++ b/internal/e2e/packages/npm2/package-lock.json @@ -0,0 +1,108 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "jasmine": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", + "integrity": "sha1-awicChFXax8W3xG4AUbZHU6Lij4=", + "requires": { + "exit": "^0.1.2", + "glob": "^7.0.6", + "jasmine-core": "~2.8.0" + } + }, + "jasmine-core": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", + "integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=" + }, + "jsesc": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.2.0.tgz", + "integrity": "sha1-9DsU6f1/BeFJuihfOlDOobjolqg=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } + } +} diff --git a/internal/e2e/packages/npm2/package.json b/internal/e2e/packages/npm2/package.json new file mode 100644 index 0000000000..5bff01fd1d --- /dev/null +++ b/internal/e2e/packages/npm2/package.json @@ -0,0 +1,10 @@ +{ + "description": "runtime dependencies for packages example", + "dependencies": { + "jsesc": "~1.2.0", + "jasmine": "2.8.0" + }, + "scripts": { + "postinstall": "node ./postinstall.js" + } +} diff --git a/internal/e2e/packages/npm3/package.json b/internal/e2e/packages/npm3/package.json new file mode 100644 index 0000000000..5bff01fd1d --- /dev/null +++ b/internal/e2e/packages/npm3/package.json @@ -0,0 +1,10 @@ +{ + "description": "runtime dependencies for packages example", + "dependencies": { + "jsesc": "~1.2.0", + "jasmine": "2.8.0" + }, + "scripts": { + "postinstall": "node ./postinstall.js" + } +} diff --git a/internal/e2e/packages/npm_determinism.spec.js b/internal/e2e/packages/npm_determinism.spec.js index 5c4147564a..1c61b4b836 100644 --- a/internal/e2e/packages/npm_determinism.spec.js +++ b/internal/e2e/packages/npm_determinism.spec.js @@ -5,8 +5,8 @@ const packageJsonPath = require.resolve('jsesc').replace('jsesc.js', 'package.js const packageJson = JSON.parse(fs.readFileSync(packageJsonPath)); const packageJsonPath2 = packageJsonPath.replace( - '/packages_example_npm_install_duplicate_for_determinism_testing/', - '/packages_example_npm_install/'); + '/internal_e2e_packages_npm_install_duplicate_for_determinism_testing/', + '/internal_e2e_packages_npm_install/'); const packageJson2 = JSON.parse(fs.readFileSync(packageJsonPath2)); describe('jsesc package.json files', () => { diff --git a/internal/e2e/packages/package.json b/internal/e2e/packages/package.json index 99d5870da4..710b1095c6 100644 --- a/internal/e2e/packages/package.json +++ b/internal/e2e/packages/package.json @@ -1,12 +1,6 @@ { - "description": "runtime dependencies for packages example", - "dependencies": { - "jsesc": "~1.2.0", - "jasmine": "2.8.0" - }, "scripts": { "postinstall": "node ./postinstall.js", - "pretest": "bazel run @nodejs//:yarn", "test": "bazel test //..." } } diff --git a/internal/e2e/packages/setup_workspace.bzl b/internal/e2e/packages/setup_workspace.bzl index de409a7409..d5532c0558 100644 --- a/internal/e2e/packages/setup_workspace.bzl +++ b/internal/e2e/packages/setup_workspace.bzl @@ -12,46 +12,46 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Helper function to setup @package_example workspace. +"""Helper function to setup @internal_e2e_packages workspace. """ load("@build_bazel_rules_nodejs//:defs.bzl", "npm_install", "yarn_install") -def packages_example_setup_workspace(): - """Node repositories for @packages_examples +def internal_e2e_packages_setup_workspace(): + """Node repositories for @internal_e2e_packagess """ npm_install( - name = "packages_example_npm_install", - package_json = "@packages_example//:package.json", - package_lock_json = "@packages_example//:package-lock.json", - data = ["@packages_example//:postinstall.js"], + name = "internal_e2e_packages_npm_install", + package_json = "@internal_e2e_packages//:npm1/package.json", + package_lock_json = "@internal_e2e_packages//:npm1/package-lock.json", + data = ["@internal_e2e_packages//:postinstall.js"], # Just here as a smoke test for this attribute prod_only = True, ) npm_install( - name = "packages_example_npm_install_duplicate_for_determinism_testing", - package_json = "@packages_example//:package.json", - package_lock_json = "@packages_example//:package-lock.json", - data = ["@packages_example//:postinstall.js"], + name = "internal_e2e_packages_npm_install_duplicate_for_determinism_testing", + package_json = "@internal_e2e_packages//:npm2/package.json", + package_lock_json = "@internal_e2e_packages//:npm2/package-lock.json", + data = ["@internal_e2e_packages//:postinstall.js"], ) npm_install( - name = "packages_example_npm_no_lockfile", - package_json = "@packages_example//:package.json", - data = ["@packages_example//:postinstall.js"], + name = "internal_e2e_packages_npm_no_lockfile", + package_json = "@internal_e2e_packages//:npm3/package.json", + data = ["@internal_e2e_packages//:postinstall.js"], ) yarn_install( - name = "packages_example_yarn_install", - package_json = "@packages_example//:package.json", - yarn_lock = "@packages_example//:yarn.lock", - data = ["@packages_example//:postinstall.js"], + name = "internal_e2e_packages_yarn_install", + package_json = "@internal_e2e_packages//:yarn1/package.json", + yarn_lock = "@internal_e2e_packages//:yarn1/yarn.lock", + data = ["@internal_e2e_packages//:postinstall.js"], ) yarn_install( - name = "packages_example_yarn_install_duplicate_for_determinism_testing", - package_json = "@packages_example//:package.json", - yarn_lock = "@packages_example//:yarn.lock", - data = ["@packages_example//:postinstall.js"], + name = "internal_e2e_packages_yarn_install_duplicate_for_determinism_testing", + package_json = "@internal_e2e_packages//:yarn2/package.json", + yarn_lock = "@internal_e2e_packages//:yarn2/yarn.lock", + data = ["@internal_e2e_packages//:postinstall.js"], ) diff --git a/internal/e2e/packages/yarn1/package.json b/internal/e2e/packages/yarn1/package.json new file mode 100644 index 0000000000..5bff01fd1d --- /dev/null +++ b/internal/e2e/packages/yarn1/package.json @@ -0,0 +1,10 @@ +{ + "description": "runtime dependencies for packages example", + "dependencies": { + "jsesc": "~1.2.0", + "jasmine": "2.8.0" + }, + "scripts": { + "postinstall": "node ./postinstall.js" + } +} diff --git a/internal/e2e/packages/yarn.lock b/internal/e2e/packages/yarn1/yarn.lock similarity index 100% rename from internal/e2e/packages/yarn.lock rename to internal/e2e/packages/yarn1/yarn.lock diff --git a/internal/e2e/packages/yarn2/package.json b/internal/e2e/packages/yarn2/package.json new file mode 100644 index 0000000000..5bff01fd1d --- /dev/null +++ b/internal/e2e/packages/yarn2/package.json @@ -0,0 +1,10 @@ +{ + "description": "runtime dependencies for packages example", + "dependencies": { + "jsesc": "~1.2.0", + "jasmine": "2.8.0" + }, + "scripts": { + "postinstall": "node ./postinstall.js" + } +} diff --git a/internal/e2e/packages/yarn2/yarn.lock b/internal/e2e/packages/yarn2/yarn.lock new file mode 100644 index 0000000000..0973a78892 --- /dev/null +++ b/internal/e2e/packages/yarn2/yarn.lock @@ -0,0 +1,84 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +glob@^7.0.6: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +jasmine-core@~2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-2.8.0.tgz#bcc979ae1f9fd05701e45e52e65d3a5d63f1a24e" + +jasmine@2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/jasmine/-/jasmine-2.8.0.tgz#6b089c0a11576b1f16df11b80146d91d4e8b8a3e" + dependencies: + exit "^0.1.2" + glob "^7.0.6" + jasmine-core "~2.8.0" + +jsesc@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.2.0.tgz#f43b14e9fd7f05e149ba285f3a50cea1b8e896a8" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" diff --git a/internal/e2e/packages/yarn_determinism.spec.js b/internal/e2e/packages/yarn_determinism.spec.js index c510e72658..875a36e6d0 100644 --- a/internal/e2e/packages/yarn_determinism.spec.js +++ b/internal/e2e/packages/yarn_determinism.spec.js @@ -5,8 +5,8 @@ const packageJsonPath = require.resolve('jsesc').replace('jsesc.js', 'package.js const packageJson = JSON.parse(fs.readFileSync(packageJsonPath)); const packageJsonPath2 = packageJsonPath.replace( - '/packages_example_yarn_install_duplicate_for_determinism_testing/', - '/packages_example_yarn_install/'); + '/internal_e2e_packages_yarn_install_duplicate_for_determinism_testing/', + '/internal_e2e_packages_yarn_install/'); const packageJson2 = JSON.parse(fs.readFileSync(packageJsonPath2)); describe('jsesc package.json files', () => { diff --git a/scripts/test_all.sh b/scripts/test_all.sh index 8e8f040778..1e92ffb177 100755 --- a/scripts/test_all.sh +++ b/scripts/test_all.sh @@ -45,7 +45,7 @@ echo_and_run bazel run //internal/e2e/fine_grained_no_bin:index echo_and_run bazel run @fine_grained_deps_yarn//typescript/bin:tsc # bazel test @examples_program//... # DOES NOT WORK WITH --nolegacy_external_runfiles -# bazel test @packages_example//... # DOES NOT WORK WITH --nolegacy_external_runfiles +# bazel test @internal_e2e_packages//... # DOES NOT WORK WITH --nolegacy_external_runfiles echo_and_run ./scripts/build_release.sh echo_and_run ./scripts/build_packages_all.sh