Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/e2e_scenarios.md
Original file line number Diff line number Diff line change
@@ -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
61 changes: 61 additions & 0 deletions tests/e2e/gen_scenario_list.py
Original file line number Diff line number Diff line change
@@ -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()