Skip to content

Commit

Permalink
Fix override of product types
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-tavares committed Jul 24, 2023
1 parent 627bb77 commit 96c45ae
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts
Expand Up @@ -240,9 +240,16 @@ export const cli = () => {

if (configFromTestFile?.productTypes) {
vars.kbnTestServer.serverArgs.push(
`--xpack.securitySolutionServerless.productTypes=${JSON.stringify(
configFromTestFile.productTypes
)}`
`--xpack.securitySolutionServerless.productTypes=${JSON.stringify([
...configFromTestFile.productTypes,
// Why spread it twice?
// The `serverless.security.yml` file by default includes two product types as of this change.
// Because it's an array, we need to ensure that existing values are "removed" and the ones
// defined here are added. To do that, we duplicate the `productTypes` passed so that all array
// elements in that ymal file are updated. The Security serverless plugin has code in place to
// dedupe.
...configFromTestFile.productTypes,
])}`
);
}
} else if (configFromTestFile?.productTypes) {
Expand Down

0 comments on commit 96c45ae

Please sign in to comment.