Skip to content

Commit

Permalink
Fix testDev builds with LavaMoat enabled (#19506)
Browse files Browse the repository at this point in the history
* Fix `devTest` build that have LavaMoat enabled

The build script compiles the LavaMoat runtime during each root task,
but it was not recognizing `testDev` as a root task. As a result, all
`testDev` builds were broken unless LavaMoat was disabled.

The list of root tasks has been updated to include `testDev`. It should
now be complete.

* Use BUILD_TARGETS constant, and enable scuttling in start:test
  • Loading branch information
Gudahtt authored Jun 19, 2023
1 parent 6bc6cba commit 8a85d22
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions development/build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const difference = require('lodash/difference');
const { intersection } = require('lodash');
const { getVersion } = require('../lib/get-version');
const { loadBuildTypesConfig } = require('../lib/build-type');
const { TASKS } = require('./constants');
const { BUILD_TARGETS, TASKS } = require('./constants');
const {
createTask,
composeSeries,
Expand All @@ -28,7 +28,6 @@ const createStaticAssetTasks = require('./static');
const createEtcTasks = require('./etc');
const { getBrowserVersionMap, getEnvironment } = require('./utils');
const { getConfig } = require('./config');
const { BUILD_TARGETS } = require('./constants');

// Packages required dynamically via browserify configuration in dependencies
// Required for LavaMoat policy generation
Expand Down Expand Up @@ -76,11 +75,11 @@ async function defineAndRunBuildTasks() {
platform,
} = await parseArgv();

const isRootTask = ['dist', 'prod', 'test', 'dev'].includes(entryTask);
const isRootTask = Object.values(BUILD_TARGETS).includes(entryTask);

if (isRootTask) {
// scuttle on production/tests environment only
const shouldScuttle = ['dist', 'prod', 'test'].includes(entryTask);
const shouldScuttle = entryTask !== BUILD_TARGETS.DEV;

console.log(
`Building lavamoat runtime file`,
Expand Down

0 comments on commit 8a85d22

Please sign in to comment.