-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[SavedObjects] Create serverless utils for jest integration tests #164157
Conversation
* main: (150 commits) Fixes unnecessary autocompletes on HTTP methods (elastic#163233) [Defend Workflows] Convert filterQuery to kql (elastic#161806) [Fleet] copy `inactivity_timeout` when duplicating agent policy (elastic#164544) Fix 7.17 forward compatibility with 8.2+ (elastic#164274) [ML] Fixes dark mode in flyouts and modals (elastic#164399) [Defend Workflows]Changes to policy settings are not persistent until a refresh (elastic#164403) [Security Solution][Endpoint] Fixes kibana crash when going back to policy details page (elastic#164329) Prepare the Security domain HTTP APIs for Serverless (elastic#162087) skip failing test suite (elastic#160986) [Security Solution] Fix flaky Event Filters test (elastic#164473) [EDR workflows] Osquery serverless tests (elastic#163795) [Fleet] Only show agent dashboard links if there is more than one non-server agent and if the dashboards exist (elastic#164469) [Chrome UI] Fix background color in serverless (elastic#164419) [DOCS] Saved objects - resolve import errors API (elastic#162825) Remove 'Create Rule' button from Rule Group page (elastic#164167) [Security Solution] expandable flyout - fix infinite loop in correlations (elastic#163450) [Remote Clusters] Update copy about port help text (elastic#164442) [api-docs] 2023-08-23 Daily api_docs build (elastic#164524) [data views] Disable scripted fields in serverless environment (elastic#163228) [Reporting] Fix - show diagnostic only when image reporting is enabled (elastic#164336) ...
startKibana: (abortSignal?: AbortSignal) => Promise<TestServerlessKibanaUtils>; | ||
} | ||
|
||
export function createTestServerlessInstances({ |
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.
Seemed easiest to just create a separate function rather than adding a flag to the existing createTestServers
logic.
However, we mirror the existing API as closely as possible so that these helpers can be easily substituted.
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.
Why didn't you name it createTestServerlessServers
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.
you said the quiet part out loud 🤫
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.
but in all seriousness: if you have a better idea for a name I'll gladly accept 😄
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.
Na, naming is hard, it's fine. We can rename later if we really want so.
/** | ||
* Until we merge https://github.com/elastic/kibana/pull/162673 this test should remain skipped. | ||
*/ | ||
describe.skip('smoke', () => { |
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 tried to get this working on CI, but it is currently timing out. It seems as though the instance might be too small to start 3 ES containers. We should also wait for QA to figure this out for FTRs.
Pinging @elastic/kibana-core (Team:Core) |
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.
LGTM
function createServerlessKibana(settings = {}, cliArgs: Partial<CliArgs> = {}) { | ||
return createRoot(defaultsDeep(settings, defaults), { ...cliArgs, serverless: true }); | ||
} |
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.
is serverless: true
here sufficient to load the serverless config file(s)?
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.
No, great point, this still needs to be figured out a bit.
I added some basic config that we'll need in serverless in the meantime:
{
server: {
restrictInternalApis: true,
versioned: {
versionResolution: 'newest',
strictClientVersionCheck: false,
},
},
migrations: {
algorithm: 'zdt',
},
elasticsearch: {
serviceAccountToken: 'BEEF',
},
}
startKibana: (abortSignal?: AbortSignal) => Promise<TestServerlessKibanaUtils>; | ||
} | ||
|
||
export function createTestServerlessInstances({ |
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.
Na, naming is hard, it's fine. We can rename later if we really want so.
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.
🥳
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
History
To update your PR or re-run it, just comment with: cc @jloleysens |
* main: (3152 commits) [Security Solution][Detection Engine] fixes 410 error on index legacy template call (#164682) [SavedObjects] Create serverless roots for jest integration tests (#164157) Create upselling package and implement EntityAnalytics serverless upselling (#164136) [Fleet] Change 'Out-of-date' to 'Outdated policy' in agent list table (#164673) [IndexManagement] Use internal base path for API (#164665) [Profiling] removing ~ symbol (#164595) [Telemetry] Fetch snapshot: allow specifying the version via querystring (#164670) [Cases] Show warning when all cases table reaches 10k cases message (#164323) [ML] Removing token list from text expansion model testing (#164560) [Fleet] Add secrets package API integration test (#164583) [Fleet] Fix security solution tag id (#164582) [Security Solution] Modal says "duplicating 0 rules" when you duplicate an individual rule (#163908) [api-docs] 2023-08-24 Daily api_docs build (#164658) [APM] Cleanup alerting api tests (#164438) Upgrade EUI to 87.2.0 (#164385) [ML] Fix query bar autocompletion for ML and AIOps embeddables (#164485) [Fleet] Fix flaky unit test for the details page (#164641) [Security Solution] update codeowner for serverless security subdir (#164640) [Security Solution] Fixes Assistant Connector and Actions RBAC Flow (#164382) [Discover] Removing large string truncation from doc viewer (#164236) ...
Summary
Introduce basic utils for instantiating serverless servers ;). Also adds a simple smoke test (that is currently skipped) demonstrating usage.
How to test
Run docker locally, check this branch out locally, un
skip
the smoke test and run:Note: the test cannot be unskipped as we are blocking on #162673 but we would like to prepare our tests so long --- they can be locally executed.
Follow up
packages/core/saved-objects/core-saved-objects-migration-server-internal/src/zdt/actions
andpackages/core/saved-objects/core-saved-objects-migration-server-internal/src/actions
).Related
#162673