[kbn-test] improve check_ftr_configs script#189357
Conversation
|
/ci |
💚 Build Succeeded
Metrics [docs]
To update your PR or re-run it, just comment with: |
| // async function config({ readConfigFile }: FtrConfigProviderContext) | ||
| // export default async function (ftrConfigProviderContext: FtrConfigProviderContext) | ||
| fileContent.match( | ||
| /(?:export\s+default\s+)?async\s+function(?:\s+\w+)?\s*\(\s*(?:\{\s*readConfigFile\s*\}|\w+)\s*(?::\s*FtrConfigProviderContext\s*)?\)/ |
There was a problem hiding this comment.
Can we name this? That's a lot of reading lol
There was a problem hiding this comment.
yes, I can put it into variable with comment
There was a problem hiding this comment.
that would be better than reading 115 characters lol
| fileContent.match(/(testRunner)|(testFiles)/) || | ||
| // export default createTestConfig | ||
| fileContent.match(/export\s+default\s+createTestConfig/) || | ||
| // export default async function ({ readConfigFile }: FtrConfigProviderContext) |
There was a problem hiding this comment.
Do you wanna drop these comments?
There was a problem hiding this comment.
I would keep it so the next person working on it have an idea of what text we are searching in files. Maybe rephrase it?
There was a problem hiding this comment.
Um, what do you mean?
Sounds like I'm missing something bud.
There was a problem hiding this comment.
fileContent is a string with js/ts file content and we use regexp to find something that might tell if it is FTR config.
It is easy see an example that you can search repo with to find if some files still has the string, e.g. export default createTestConfig
Summary
Follow-up to #188854
On CI script is taking >1 min, while before it was taking seconds.
Probably because 80+ files were loaded as potential FTR configs. I adjusted regular expressions to minimize the amount of files that we need to load to validate if it is FTR config or not.
In this CI run script took 20s (part of
Quick Checksgroup)