From d2d7763a5ff419a80405f7d8c1bfe6639b2547e6 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Mon, 14 Mar 2022 11:45:34 -0400 Subject: [PATCH] [plugin-helpers] Skip build.test.ts log matching on ci-stats service (#127560) (#127602) This copies the fix over from https://github.com/elastic/kibana/pull/123510 to be used in both plugin-helpers build calls. Closes #89079 (cherry picked from commit 371c52a1ed383183ba9dd61938b7ca477bf4c365) Co-authored-by: Jonathan Budzenski --- .../src/integration_tests/build.test.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts b/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts index 71a3fbe603718..2d7664aa13326 100644 --- a/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts +++ b/packages/kbn-plugin-helpers/src/integration_tests/build.test.ts @@ -43,8 +43,14 @@ it('builds a generated plugin into a viable archive', async () => { all: true, } ); + const filterLogs = (logs: string | undefined) => { + return logs + ?.split('\n') + .filter((l) => !l.includes('failed to reach ci-stats service')) + .join('\n'); + }; - expect(generateProc.all).toMatchInlineSnapshot(` + expect(filterLogs(generateProc.all)).toMatchInlineSnapshot(` " succ 🎉 Your plugin has been created in plugins/foo_test_plugin @@ -60,12 +66,7 @@ it('builds a generated plugin into a viable archive', async () => { } ); - expect( - buildProc.all - ?.split('\n') - .filter((l) => !l.includes('failed to reach ci-stats service')) - .join('\n') - ).toMatchInlineSnapshot(` + expect(filterLogs(buildProc.all)).toMatchInlineSnapshot(` " info deleting the build and target directories info running @kbn/optimizer │ info initialized, 0 bundles cached