Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
#66: Add tests markers
Browse files Browse the repository at this point in the history
  • Loading branch information
blackandred committed Aug 19, 2021
1 parent 955c2c9 commit ee42d69
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[pytest]
markers =
argparsing: Argument parsing and CLI-related things, usage from commandline
e2e: Heavy end-to-end and functional tests that are engaging subprocesses, external applications, asserting output
long: Tests that are taking very long to finish
2 changes: 2 additions & 0 deletions src/core/tests/test_functional.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3

import pytest
import os
import sys
import tempfile
Expand All @@ -10,6 +11,7 @@
SCRIPT_DIR_PATH = os.path.dirname(os.path.realpath(__file__))


@pytest.mark.e2e
class TestFunctional(FunctionalTestingCase):
"""
Runs application like from the shell, captures output and performs assertions on the results.
Expand Down
2 changes: 2 additions & 0 deletions src/core/tests/test_functional_subprojects.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/env python3

import pytest
import os
from rkd.core.api.testing import FunctionalTestingCase
from rkd.process import switched_workdir

TESTS_DIR = os.path.dirname(os.path.realpath(__file__))


@pytest.mark.e2e
class TestFunctionalSubprojects(FunctionalTestingCase):
def test_subproject_tasks_are_included(self):
"""
Expand Down
3 changes: 3 additions & 0 deletions src/core/tests/test_standardlib_createstructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import subprocess
import pytest
from tempfile import TemporaryDirectory
from rkd.core.api.testing import BasicTestingCase
from rkd.core.standardlib import CreateStructureTask
Expand All @@ -11,6 +12,8 @@
NAMESPACE_DIR = TESTS_DIR + '/../../'


@pytest.mark.e2e
@pytest.mark.long
class CreateStructureTaskTest(BasicTestingCase):
@staticmethod
def _execute_mocked_task(params: dict, envs: dict = None, task: CreateStructureTask = None) -> BufferedSystemIO:
Expand Down
2 changes: 2 additions & 0 deletions src/core/tests/test_standardlib_jinja_file_render.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#!/usr/bin/env python3

import os
import pytest
from rkd.core.standardlib.jinja import FileRendererTask
from rkd.core.api.inputoutput import BufferedSystemIO
from rkd.core.api.testing import BasicTestingCase

SAMPLES_PATH = os.path.dirname(os.path.realpath(__file__)) + '/internal-samples'


@pytest.mark.e2e
class TestFileRendererTask(BasicTestingCase):
"""Tests for a task that should render single JINJA2 file from SOURCE PATH to TARGET PATH
"""
Expand Down
2 changes: 2 additions & 0 deletions src/core/tests/test_standardlib_jinja_render_directory.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/usr/bin/env python3

import os
import pytest
from rkd.core.api.testing import BasicTestingCase
from rkd.core.standardlib.jinja import RenderDirectoryTask

TESTS_DIR = os.path.dirname(os.path.realpath(__file__))


@pytest.mark.e2e
class TestRenderDirectoryTask(BasicTestingCase):
"""Tests for a task that should render JINJA2 files from DIRECTORY "A" to DIRECTORY "B"
"""
Expand Down
2 changes: 2 additions & 0 deletions src/core/tests/test_standardlib_lineinfiletask.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env python3

import pytest
from tempfile import NamedTemporaryFile
from rkd.core.api.testing import BasicTestingCase
from rkd.core.standardlib import LineInFileTask
from rkd.core.api.inputoutput import BufferedSystemIO


@pytest.mark.e2e
class LineInFileTaskTest(BasicTestingCase):
@staticmethod
def _execute_mocked_task(params: dict, envs: dict = {}) -> BufferedSystemIO:
Expand Down
2 changes: 2 additions & 0 deletions src/core/tests/test_standardlib_taskslistingtask.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/usr/bin/env python3

import pytest
from rkd.core.api.testing import BasicTestingCase
from rkd.core.standardlib import TasksListingTask
from rkd.core.test import get_test_declaration


@pytest.mark.e2e
class TestTasksListingTask(BasicTestingCase):
def test_ljust_task_name(self):
"""Assert that the formatting is not breaking the description alignment
Expand Down

0 comments on commit ee42d69

Please sign in to comment.