@@ -64,30 +64,7 @@ run: ## Run the service locally
64
64
print-version : # # Print the service version
65
65
python runner.py --version
66
66
67
- test : test-unit test-integration test-e2e # # Run all tests
68
-
69
- benchmarks : # # Run benchmarks
70
- @echo " Running benchmarks..."
71
- pdm run pytest tests/benchmarks --benchmark-histogram
72
-
73
- test-unit : # # Run the unit tests
74
- @echo " Running unit tests..."
75
- @echo " Reports will be written to ${ARTIFACT_DIR} "
76
- COVERAGE_FILE=" ${ARTIFACT_DIR} /.coverage.unit" pdm run pytest tests/unit --cov=ols --cov=runner --cov-report term-missing --cov-report " json:${ARTIFACT_DIR} /coverage_unit.json" --junit-xml=" ${ARTIFACT_DIR} /junit_unit.xml"
77
- pdm run scripts/transform_coverage_report.py " ${ARTIFACT_DIR} /coverage_unit.json" " ${ARTIFACT_DIR} /coverage_unit.out"
78
- scripts/codecov.sh " ${ARTIFACT_DIR} /coverage_unit.out"
79
-
80
- test-integration : # # Run integration tests tests
81
- @echo " Running integration tests..."
82
- @echo " Reports will be written to ${ARTIFACT_DIR} "
83
- COVERAGE_FILE=" ${ARTIFACT_DIR} /.coverage.integration" pdm run pytest -m ' not redis' tests/integration --cov=ols --cov=runner --cov-report term-missing --cov-report " json:${ARTIFACT_DIR} /coverage_integration.json" --junit-xml=" ${ARTIFACT_DIR} /junit_integration.xml" --cov-fail-under=60
84
- pdm run scripts/transform_coverage_report.py " ${ARTIFACT_DIR} /coverage_integration.json" " ${ARTIFACT_DIR} /coverage_integration.out"
85
- scripts/codecov.sh " ${ARTIFACT_DIR} /coverage_integration.out"
86
-
87
- check-coverage : test-unit test-integration # # Unit tests and integration tests overall code coverage check
88
- coverage combine --keep " ${ARTIFACT_DIR} /.coverage.unit" " ${ARTIFACT_DIR} /.coverage.integration"
89
- # the threshold should be very high there, in theory it should reach 100%
90
- coverage report -m --fail-under=94
67
+ test : test-e2e # # Run all tests
91
68
92
69
test-e2e : # # Run e2e tests - requires running OLS server
93
70
@echo " Running e2e tests..."
@@ -101,73 +78,23 @@ test-eval: ## Run evaluation tests - requires running OLS server
101
78
pdm run pytest tests/e2e/evaluation -vv -s --durations=0 -o junit_suite_name=" ${SUITE_ID} " --junit-prefix=" ${SUITE_ID} " --junit-xml=" ${ARTIFACT_DIR} /junit_e2e_${SUITE_ID} .xml" \
102
79
--eval_out_dir ${ARTIFACT_DIR}
103
80
104
- coverage-report : unit-tests-coverage-report integration-tests-coverage-report # # Export coverage reports into interactive HTML
105
-
106
- unit-tests-coverage-report : test-unit # # Export unit test coverage report into interactive HTML
107
- coverage html --data-file=" ${ARTIFACT_DIR} /.coverage.unit" -d htmlcov-unit
108
-
109
- integration-tests-coverage-report : test-integration # # Export integration test coverage report into interactive HTML
110
- coverage html --data-file=" ${ARTIFACT_DIR} /.coverage.integration" -d htmlcov-integration
111
-
112
- check-types : # # Checks type hints in sources
113
- pdm run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs ols/
114
-
115
- security-check : # # Check the project for security issues
116
- bandit -c pyproject.toml -r .
117
-
118
- format : # # Format the code into unified format
119
- pdm run black .
120
- pdm run ruff check . --fix
121
-
122
81
verify : install-woke install-deps-test # # Verify the code using various linters
123
82
pdm run black . --check
124
83
pdm run ruff check .
125
84
./woke . --exit-1-on-failure
126
- pylint ols scripts tests runner.py
127
- pdm run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs ols/
128
-
129
- schema : # # Generate OpenAPI schema file
130
- python scripts/generate_openapi_schema.py docs/openapi.json
85
+ pylint our_ols scripts tests runner.py
86
+ pdm run mypy --explicit-package-bases --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs our_ols/
131
87
132
88
requirements.txt : pyproject.toml pdm.lock # # Generate requirements.txt file containing hashes for all non-devel packages
133
89
pdm export --prod --format requirements --output requirements.txt --no-extras --without evaluation
134
90
135
- verify-packages-completeness : requirements.txt # # Verify that requirements.txt file contains complete list of packages
136
- pip download -d /tmp/ --use-pep517 --verbose -r requirements.txt
137
-
138
91
get-rag : # # Download a copy of the RAG embedding model and vector database
139
92
podman create --replace --name tmp-rag-container $$(grep 'ARG LIGHTSPEED_RAG_CONTENT_IMAGE' Containerfile | awk 'BEGIN{FS="="}{print $$2}' ) true
140
93
rm -rf vector_db embeddings_model
141
94
podman cp tmp-rag-container:/rag/vector_db vector_db
142
95
podman cp tmp-rag-container:/rag/embeddings_model embeddings_model
143
96
podman rm tmp-rag-container
144
97
145
- config.puml : # # Generate PlantUML class diagram for configuration
146
- pyreverse ols/app/models/config.py --output puml --output-directory=docs/
147
- mv docs/classes.puml docs/config.puml
148
-
149
- docs/config.png : docs/config.puml # # Generate an image with configuration graph
150
- pushd docs && \
151
- java -jar ${PATH_TO_PLANTUML} /plantuml.jar --theme rose config.puml && \
152
- mv classes.png config.png && \
153
- popd
154
-
155
- llms.puml : # # Generate PlantUML class diagram for LLM plugin system
156
- pyreverse ols/src/llms/ --output puml --output-directory=docs/
157
- mv docs/classes.puml docs/llms_classes.uml
158
- mv docs/packages.puml docs/llms_packages.uml
159
-
160
- distribution-archives : # # Generate distribution archives to be uploaded into Python registry
161
- pdm run python -m build
162
-
163
- upload-distribution-archives : # # Upload distribution archives into Python registry
164
- pdm run python -m twine upload --repository ${PYTHON_REGISTRY} dist/*
165
-
166
- shellcheck : # # Run shellcheck
167
- wget -qO- " https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz" | tar -xJv \
168
- shellcheck --version
169
- shellcheck -- * /* .sh
170
-
171
98
help : # # Show this help screen
172
99
@echo ' Usage: make <OPTIONS> ... <TARGETS>'
173
100
@echo ' '
0 commit comments