From eab278d593e4427cd62d5ef82ad0111473df172d Mon Sep 17 00:00:00 2001 From: Daniel Mitterdorfer Date: Fri, 22 Dec 2023 08:14:03 +0100 Subject: [PATCH] [Profiling] Add REST test case With this commit we add REST test cases for Universal Profiling. --- .../rest-api-spec/test/profiling/10_basic.yml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/profiling/10_basic.yml diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/profiling/10_basic.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/profiling/10_basic.yml new file mode 100644 index 0000000000000..6833605c5d0ef --- /dev/null +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/profiling/10_basic.yml @@ -0,0 +1,46 @@ +--- +setup: + - skip: + version: " - 8.12.99" + reason: "Universal Profiling test infrastructure is available in 8.12+" + + - do: + cluster.put_settings: + body: + persistent: + xpack.profiling.templates.enabled: true + + - do: + profiling.status: + wait_for_resources_created: true + +# TODO: Bulk index all data +# - do: +# bulk: +# index: "profiling-events-all" +# refresh: true +# body: +# - { "index": { } } +# - { "data": 1, "count": 40, "data_d": 1, "count_d": 40, "time": 1674835275187, "color": "red" } + + +--- +"Test Status": + - do: + profiling.status: + + - match: {profiling.enabled: true} + - match: {resource_management.enabled: true} + - match: {resources.created: true} + - match: {resources.pre_8_9_1_data: false} + # The assertion is intentionally wrong as we want to provoke a test failure + - match: {resources.has_data: true} + +--- +# TODO: Delete data? +teardown: + - do: + cluster.put_settings: + body: + persistent: + xpack.profiling.templates.enabled: false