-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FTR] split configs by target into multiple manifest files #187440
[FTR] split configs by target into multiple manifest files #187440
Conversation
A documentation preview will be available soon. Request a new doc build by commenting
If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here. |
/ci |
/ci |
@@ -16,8 +16,11 @@ import { BuildkiteClient, BuildkiteStep } from '../buildkite'; | |||
import { CiStatsClient, TestGroupRunOrderResponse } from './client'; | |||
|
|||
import DISABLED_JEST_CONFIGS from '../../disabled_jest_configs.json'; | |||
import { serverless, stateful } from './ftr_configs_manifests.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using json to store manifests paths because importing constant from .buildkite/pipeline-utils
into packages/kbn-test
won't work and I don't like the idea of solving it with ts-ignore
. Open for suggestions here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding living in two different tsconfig.json files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding living in two different tsconfig.json files?
This code is living on its own, but manifest files loading is also happening in packages/kbn-test
. The issue is that pipeline-utils is not a package, otherwise we can easily import it as a dependency.
I think for the start json is ok, but maybe we should change depending on how we plan to access the manifest based on distro/project type
.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts
Outdated
Show resolved
Hide resolved
- ftr_oblt_stateful_configs.yml | ||
- ftr_security_stateful_configs.yml | ||
- ftr_search_stateful_configs.yml | ||
If you’re writing a plugin outside the {kib} repo, you will have your own config file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pheyos This is the only place where we mentioned original manifest file. Do you think we need to add more context here or put this info in other place?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine and we don't need to add more context here.
@@ -67,7 +67,7 @@ async function getConfigModule({ | |||
) { | |||
const rel = Path.relative(REPO_ROOT, resolvedPath); | |||
throw createFlagError( | |||
`Refusing to load FTR Config at [${rel}] which is not listed in [${FTR_CONFIGS_MANIFEST_REL}]. All FTR Config files must be listed there, use the "enabled" key if the FTR Config should be run on automatically on PR CI, or the "disabled" key if it is run manually or by a special job.` | |||
`Refusing to load FTR Config at [${rel}] which is not listed in [${ALL_FTR_MANIFEST_REL_PATHS}]. All FTR Config files must be listed in one of manifest files, use the "enabled" key if the FTR Config should be run on automatically on PR CI, or the "disabled" key if it is run manually or by a special job.` | |||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will print out all the manifests here, but probably we can only print the ones related to the distro (e.g. only serverless manifests) assuming the FTR config has a clear definition where it should be run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 70 is a little bit like a wall of text, can we break it up a tiny bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I will split it
.buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts
Outdated
Show resolved
Hide resolved
/ci |
/ci |
`The following files look like FTR configs which are not listed in one of manifest files:\nstateful: ${manifestPaths.stateful}\nserverless: ${manifestPaths.serverless}\n - ${invalidList}` | ||
); | ||
throw createFailError( | ||
`Please add the listed paths to .buildkite/ftr_configs.yml. If it's not an FTR config, you can add it to the IGNORED_PATHS in ${THIS_REL} or contact #kibana-operations` | ||
`Please add the listed paths to the correct manifest file. If it's not an FTR config, you can add it to the IGNORED_PATHS in ${THIS_REL} or contact #kibana-operations` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After update the message is:
ERROR The following files look like FTR configs which are not listed in one of manifest files:
stateful: .buildkite/ftr_platform_stateful_configs.yml,.buildkite/ftr_oblt_stateful_configs.yml,.buildkite/ftr_security_stateful_configs.yml,.buildkite/ftr_search_stateful_configs.yml
serverless: .buildkite/ftr_base_serverless_configs.yml,.buildkite/ftr_oblt_serverless_configs.yml,.buildkite/ftr_security_serverless_configs.yml,.buildkite/ftr_search_serverless_configs.yml
- x-pack/test/api_integration/apis/cloud_security_posture/config.ts
- x-pack/test/cloud_security_posture_api/config.ts
- x-pack/test/cloud_security_posture_functional/config.ts
- x-pack/test/fleet_cypress/cli_config.ts
- x-pack/test/fleet_cypress/visual_config.ts
- x-pack/test/functional/apps/apm/config.ts
- x-pack/test/functional/apps/search_playground/config.ts
ERROR Please add the listed paths to the correct manifest file. If it's not an FTR config, you can add it to the IGNORED_PATHS in packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts or contact #kibana-operations
…ibana into ftr/split-configs-by-target
/ci |
var path = require('path'); | ||
|
||
var manifestsJsonPath = path.resolve(__dirname, '../.buildkite/ftr_configs_manifests.json'); | ||
console.log(manifestsJsonPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use an actual logger, instead of console?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, it's probably not loaded yet right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is a vanilla js script that you added a while ago, my change broke it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added? I can't recall, but I believe ya
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see now.
uniqueQueues.add(manifest.defaultQueue); | ||
} | ||
} catch (_) { | ||
const error = _ instanceof Error ? _ : new Error(`${_} thrown`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personal happy (opposite of nit) is the _
.
Years of fp makes me happy to see this Dima.
No wasted time or thought in naming an uninteresting symbol. Good stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to make as little changes as possible and kept the original error handling by Brian in place, not sure about the code style that was followed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a notation style very common in fp langs, such as Haskell, F#.Net, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and in javascript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me. The current changes are a good first step forward on setting the stones to achieve future ability on running only a current type of tests. Also it doesn't seems like the current changes are going to affect for now the ci stats.
It will affect flaky test runner as manifest file is replaced with multiple ones, but if we merge elastic/kibana-ci-stats/pull/831 first backward compatibility will be in place |
💚 Build Succeeded
Metrics [docs]
History
|
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
## Summary During #187440 we lost some FTR configs, this PR adds it back.
## Summary Follow-up to #188825 @crespocarlos reported that some Oblt configs after missing after #187440 I was using `node scripts/check_ftr_configs.js` to validate I did not miss anything and decided to debug the script. We had a pretty strict config file content validation like `testRunner|testFiles`, that was skipping some FTR configs like `x-pack/test/apm_api_integration/basic/config.ts` I extended file content check to look for default export function and also skip test/suite or Cypress-own config files. In the end 7 FTR configs were discovered, but only 2 are with tests. I will ask owners to confirm if it should be enabled/disabled. Script run output: ``` node scripts/check_ftr_configs.js ERROR The following files look like FTR configs which are not listed in one of manifest files: - x-pack/plugins/observability_solution/uptime/e2e/config.ts - x-pack/test/functional_basic/apps/ml/config.base.ts - x-pack/test/functional_basic/apps/transform/config.base.ts - x-pack/test/security_solution_api_integration/config/ess/config.base.trial.ts - x-pack/test_serverless/functional/test_suites/observability/cypress/oblt_config.base.ts Make sure to add your new FTR config to the correct manifest file. Stateful tests: .buildkite/ftr_platform_stateful_configs.yml .buildkite/ftr_oblt_stateful_configs.yml .buildkite/ftr_security_stateful_configs.yml .buildkite/ftr_search_stateful_configs.yml Serverless tests: .buildkite/ftr_base_serverless_configs.yml .buildkite/ftr_oblt_serverless_configs.yml .buildkite/ftr_security_serverless_configs.yml .buildkite/ftr_search_serverless_configs.yml ERROR Please add the listed paths to the correct manifest file. If it's not an FTR config, you can add it to the IGNORED_PATHS in packages/kbn-test/src/functional_test_runner/lib/config/run_check_ftr_configs_cli.ts or contact #kibana-operations ```
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
3 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Summary
Part of #186515
Split FTR configs manifest into multiple files based on distro (serverless/stateful) and area of testing (platform/solutions)
Update the CI scripts to support the change, but without logic modification
More context:
With this change we will have a clear split of FTR test configs owned by Platform and Solutions. It is a starting point to make configs discoverable, our test pipelines be flexible and run tests based on distro/solution.