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
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ package: substitute-debian

test: substitute-sources
pytest test/unit -vv
pytest test/misc -vv
make clean-cache

autotest:
Expand Down Expand Up @@ -184,17 +185,22 @@ general-help:
@echo
@echo "Commands:"
@echo " install Install on the local computer without using package manager;"
@echo " uninstall Remove installed util from system;"
@echo " man Create man file."
@echo " Require argparse-manpage python library;"
@echo " uninstall Removes the installed utility from the system;"
@echo " reinstall Removes the installed utility from the system and then installs it again;"
@echo " man Create man file. Require argparse-manpage python library;"
@echo " pre-commit Runs all pre-commit hooks;"
@echo " test Runs unit tests with pytest framework;"
@echo " autotest Runs auto tests."
@echo " Required installed '$(UTIL_NAME)' util and provided ACCESS_TOKEN;"
@echo " substitute-sources Substitutes dynamic variables into source code files and generates final files;"
@echo " substitute-debian Substitutes dynamic variables into debian files and generates final files;"
@echo " substitute-docker Substitutes dynamic variables into docker files and generates final files;"
@echo " package Build the debian package;"
@echo " clean-cache Delete __pycache__ folders created by pytest framework;"
@echo " clean Remove generated while installing and testing files in the source directory (contains clean-cache);"
@echo " clean-all Remove all generated files such as created docker files, debian and sources (contains clean);"
@echo " todo-list Displays what is good to do in the source code;"
@echo " general-help Displays information about upper-level targets;"
@echo " help Displays information about all available targets."
@echo

Expand Down
6 changes: 4 additions & 2 deletions docker/docker.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
docker-help:
@echo "Docker:"
@echo " docker-run Runs docker container with installed util;"
@echo " docker-image Build docker image;"
@echo " docker-image Builds a docker image;"
@echo " ALL=[1|0] REBUILD=[1|0]"
@echo " docker-base-image Builds a basic docker image from which to build other images;"
@echo " docker-test-image Builds a docker image for running tests and building package;"
@echo " docker-test Runs unit tests with pytest framework in the docker container;"
@echo " docker-autotest Runs autotests in docker container;"
@echo " docker-build-package Build the debian package in special docker image;"
@echo " docker-build-package Builds the debian package in special docker image;"
@echo " docker-rmi ALL=[1|0] Delete created docker images;"
@echo " docker-help Displays information about available docker targets."
@echo
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"Babel==2.15.0",
"Cython~=3.0.8",
"setuptools~=75.8.0",
"Jinja2~=3.1.2",
)
INSTALL_REQUIREMENTS: tuple[str, ...] = (
"argcomplete~=2.0.0",
Expand Down
11 changes: 0 additions & 11 deletions test/conftest.py

This file was deleted.

44 changes: 44 additions & 0 deletions test/misc/test_makefile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import re
import subprocess
from typing import Final

import pytest

TARGET_PATTERN = re.compile(r"^[a-zA-Z0-9-]*:\s*")
MAKEFILE_NAME: Final = "Makefile"


@pytest.fixture
def makefile_targets() -> set[str]:
result = subprocess.run(
["make", "-qp"],
encoding="utf-8",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
targets = set()
for line in result.stdout.splitlines():
if not TARGET_PATTERN.search(line):
continue
target_name = line.split(":")[0]
if target_name == MAKEFILE_NAME:
continue
targets.add(target_name)
assert targets, "No targets found, maybe error occurred."
return targets


def test_makefile_consist_help_msgs_for_all_targets(makefile_targets: set[str]):
make_help_stdout = subprocess.run(
["make", "help"],
encoding="utf-8",
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
check=True,
).stdout
targets_without_help = {
target for target in makefile_targets if target not in make_help_stdout
}
assert (
not targets_without_help
), f"Help message for the '{targets_without_help}' targets not found."
Loading