Fix kbn/optimizer tests (#70827)

Co-authored-by: spalger <spalger@users.noreply.github.com>
This commit is contained in:
Spencer 2020-07-06 11:13:17 -07:00 committed by GitHub
parent bd952721a4
commit 44925311fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 74 additions and 6 deletions

File diff suppressed because one or more lines are too long

View file

@ -24,7 +24,7 @@ import { inspect } from 'util';
import cpy from 'cpy';
import del from 'del';
import { toArray, tap } from 'rxjs/operators';
import { toArray, tap, filter } from 'rxjs/operators';
import { ToolingLog, REPO_ROOT } from '@kbn/dev-utils';
import { runOptimizer, OptimizerConfig, OptimizerUpdate, logOptimizerState } from '@kbn/optimizer';
@ -63,8 +63,7 @@ afterAll(async () => {
await del(TMP_DIR);
});
// FLAKY: https://github.com/elastic/kibana/issues/70762
it.skip('builds expected bundles, saves bundle counts to metadata', async () => {
it('builds expected bundles, saves bundle counts to metadata', async () => {
const config = OptimizerConfig.create({
repoRoot: MOCK_REPO_DIR,
pluginScanDirs: [Path.resolve(MOCK_REPO_DIR, 'plugins')],
@ -75,7 +74,11 @@ it.skip('builds expected bundles, saves bundle counts to metadata', async () =>
expect(config).toMatchSnapshot('OptimizerConfig');
const msgs = await runOptimizer(config)
.pipe(logOptimizerState(log, config), toArray())
.pipe(
logOptimizerState(log, config),
filter((x) => x.event?.type !== 'worker stdio'),
toArray()
)
.toPromise();
const assert = (statement: string, truth: boolean, altStates?: OptimizerUpdate[]) => {
@ -168,8 +171,7 @@ it.skip('builds expected bundles, saves bundle counts to metadata', async () =>
`);
});
// FLAKY: https://github.com/elastic/kibana/issues/70764
it.skip('uses cache on second run and exist cleanly', async () => {
it('uses cache on second run and exist cleanly', async () => {
const config = OptimizerConfig.create({
repoRoot: MOCK_REPO_DIR,
pluginScanDirs: [Path.resolve(MOCK_REPO_DIR, 'plugins')],