Skip to content

Commit

Permalink
build: move jasmine seed generation logic to karma config (angular#46798
Browse files Browse the repository at this point in the history
)

The jasmine seed generator is only used in a single karma configuration
file. Used by the legacy build and the Saucelabs/ZoneJS Karma jobs.

We should move the separate script code directly into the config to make
it clear that the seed generation is not used elsewhere, and to simplify
the Starlark code.

PR Close angular#46798
  • Loading branch information
devversion authored and thePunderWoman committed Jul 12, 2022
1 parent 9f9e4f2 commit 1596902
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
6 changes: 4 additions & 2 deletions karma-js.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
*/

const browserProvidersConf = require('./browser-providers.conf');
const {generateSeed} = require('./tools/jasmine-seed-generator');
const {hostname} = require('os');

const seed = process.env.JASMINE_RANDOM_SEED || String(Math.random()).slice(-5);
console.info(`Jasmine random seed: ${seed}`);

module.exports = function(config) {
const conf = {
frameworks: ['jasmine'],

client: {
jasmine: {
random: true,
seed: generateSeed('karma-js.conf'),
seed,
},
captureConsole: true,
},
Expand Down
1 change: 0 additions & 1 deletion packages/zone.js/test/karma_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def karma_test(name, env_srcs, env_deps, env_entry_point, test_srcs, test_deps,
configuration_env_vars = ["KARMA_WEB_TEST_MODE"],
data = [
"//:browser-providers.conf.js",
"//tools:jasmine-seed-generator.js",
],
static_files = [
":assets/sample.json",
Expand Down
1 change: 0 additions & 1 deletion tools/defaults.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ def karma_web_test_suite(name, **kwargs):
deps = deps,
data = data + [
"//:browser-providers.conf.js",
"//tools:jasmine-seed-generator.js",
],
karma = "//tools/saucelabs:karma-saucelabs",
tags = tags + [
Expand Down
19 changes: 0 additions & 19 deletions tools/jasmine-seed-generator.js

This file was deleted.

0 comments on commit 1596902

Please sign in to comment.