Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vulder committed Oct 20, 2024
1 parent 122a48c commit 28b83ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
6 changes: 2 additions & 4 deletions docs/source/vara-ts/vara-buildsetup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ installation (if necessary).
.. code-block:: console
# cd to VaRA-TS directory
python3 -m pip install --user --upgrade -e ./varats-core
python3 -m pip install --user --upgrade -e ./varats
python3 -m pip install --user --upgrade -e varats
# developers also need to execute the next command
# (if you want to contribute to VaRA/VaRA-TS):
Expand All @@ -80,8 +79,7 @@ Install to python virtualenv (advanced)
source /path/to/virtualenv/bin/activate
# cd to VaRA-TS directory
python3 -m pip install --upgrade -e ./varats-core
python3 -m pip install --upgrade -e ./varats
python3 -m pip install --upgrade -e varats
# developers also need to execute the next command
# (if you want to contribute to VaRA/VaRA-TS):
Expand Down
25 changes: 6 additions & 19 deletions tests/test_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
RunLayer,
EntryPoint,
)

from tests.helper_utils import run_in_test_environment
from varats.containers.containers import (
ImageBase,
StageBuilder,
Expand All @@ -25,6 +23,8 @@
from varats.tools.research_tools.research_tool import Distro
from varats.utils.settings import vara_cfg, bb_cfg

from tests.helper_utils import run_in_test_environment


class TestImageBase(unittest.TestCase):
"""Test ImageBase class."""
Expand Down Expand Up @@ -101,10 +101,8 @@ def test_create_stage_10_from_pip(self) -> None:

varats_core_install_layer = self.check_layer_type(layers[2], RunLayer)
self.assertEqual("pip", varats_core_install_layer.command)
self.assertTupleEqual(
("install", "--ignore-installed", "varats-core", "varats"),
varats_core_install_layer.args
)
self.assertTupleEqual(("install", "--ignore-installed", "varats"),
varats_core_install_layer.args)

@run_in_test_environment()
def test_create_stage_10_from_source(self) -> None:
Expand All @@ -126,20 +124,9 @@ def test_create_stage_10_from_source(self) -> None:
layers = stage_builder.layers
self.check_layer_type(layers[0], FromLayer)

varats_core_install_layer = self.check_layer_type(layers[4], RunLayer)
self.assertEqual("pip", varats_core_install_layer.command)
self.assertTupleEqual(("install", "/varats/varats-core"),
varats_core_install_layer.args)
mounting_parameters = "type=bind,src=varats_src,target=/varats"
if buildah_version() >= (1, 24, 0):
mounting_parameters += ",rw"
self.assertIn(("mount", mounting_parameters),
varats_core_install_layer.kwargs)

varats_install_layer = self.check_layer_type(layers[5], RunLayer)
varats_install_layer = self.check_layer_type(layers[4], RunLayer)
self.assertEqual("pip", varats_install_layer.command)
self.assertTupleEqual(("install", "/varats/varats"),
varats_install_layer.args)
self.assertTupleEqual(("install", "/varats"), varats_install_layer.args)
mounting_parameters = "type=bind,src=varats_src,target=/varats"
if buildah_version() >= (1, 24, 0):
mounting_parameters += ",rw"
Expand Down

0 comments on commit 28b83ec

Please sign in to comment.