From 0024e06c7555728c42cf20b27a5af44d9d934b28 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 7 Jul 2025 08:41:22 +0200 Subject: [PATCH 1/2] LCORE-317: tooling to generate list of scenarios --- tests/e2e/gen_scenario_list.py | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tests/e2e/gen_scenario_list.py diff --git a/tests/e2e/gen_scenario_list.py b/tests/e2e/gen_scenario_list.py new file mode 100644 index 00000000..81c9cd89 --- /dev/null +++ b/tests/e2e/gen_scenario_list.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python3 + +# Copyright © 2022, 2023, 2025 Pavel Tisnovsky +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Scenario list generator.""" + +# Usage +# python gen_scenario_list.py > docs/scenarios_list.md + +import os + +# URL prefix to create links to feature files +FEATURES_URL_PREFIX = "https://github.com/lightspeed-core/lightspeed-stack/blob/main/tests/e2e/features" # noqa E501 + +# list of prefixes for scenarios or scenario outlines +PREFIXES = ("Scenario: ", "Scenario Outline: ") + +# sub-directory where feature files are stored +FEATURE_DIRECTORY = "features" + +# generate page header +print("---") +print("layout: page") +print("nav_order: 3") +print("---") +print() +print("# List of scenarios") +print() + +# generage list of scenarios +directory = FEATURE_DIRECTORY +# files within one subdirectory needs to be sorted so the +# resulting scenario list will have stable structure across versions +files = sorted(os.listdir(directory)) +for filename in files: + # grep all .feature files + if filename.endswith(".feature"): + # feature file header + print("## [`{}`]({}/{})\n".format(filename, FEATURES_URL_PREFIX, filename)) + with open(os.path.join(directory, filename), "r") as fin: + for line in fin.readlines(): + line = line.strip() + # process all scenarios and scenario outlines + for prefix in PREFIXES: + if line.startswith(prefix): + line = line[len(prefix) :] + print(f"* {line}") + # vertical space between subsections in generated file + print() From 9acb538ee4de00f9755daf004b09e53bb2512a32 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Mon, 7 Jul 2025 08:41:35 +0200 Subject: [PATCH 2/2] Generated list of scenarioss --- docs/e2e_scenarios.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/e2e_scenarios.md diff --git a/docs/e2e_scenarios.md b/docs/e2e_scenarios.md new file mode 100644 index 00000000..754eb9b2 --- /dev/null +++ b/docs/e2e_scenarios.md @@ -0,0 +1,16 @@ +# List of scenarios + +## [`smoketests.feature`](https://github.com/lightspeed-core/lightspeed-stack/blob/main/tests/e2e/features/smoketests.feature) + +* Check if the main endpoint is reachable + +## [`rest_api.feature`](https://github.com/lightspeed-core/lightspeed-stack/blob/main/tests/e2e/features/rest_api.feature) + +* Check if service report proper readiness state +* Check if service report proper liveness state +* Check if the OpenAPI endpoint works as expected +* Check if info endpoint is working + +## [`llm_interface.feature`](https://github.com/lightspeed-core/lightspeed-stack/blob/main/tests/e2e/features/llm_interface.feature) + +* Check if LLM responds to sent question