Skip to content

Commit

Permalink
Merge branch 'release/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
lueschem committed Feb 21, 2020
2 parents 522fba9 + 14251d3 commit 8716da5
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 80 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ services:
install:
- docker pull debian:stretch
- docker pull debian:buster
- docker pull ubuntu:16.04
- docker pull ubuntu:18.04
- docker pull ubuntu:19.10
- docker pull ubuntu:20.04
script:
- docker run -v $(pwd):/data/edi ubuntu:16.04 bash -c "/data/edi/travis/travis-build"
- docker run -v $(pwd):/data/edi ubuntu:18.04 bash -c "/data/edi/travis/travis-build"
- docker run -v $(pwd):/data/edi ubuntu:19.10 bash -c "/data/edi/travis/travis-build"
- docker run -v $(pwd):/data/edi ubuntu:20.04 bash -c "/data/edi/travis/travis-build"
- docker run -v $(pwd):/data/edi debian:stretch bash -c "/data/edi/travis/travis-build"
- docker run -v $(pwd):/data/edi debian:buster bash -c "/data/edi/travis/travis-build"
branches:
Expand Down
9 changes: 9 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
edi (1.2.1) bionic; urgency=medium

[ Matthias Lüscher ]
* Get rid of deprecation warnings on Ubuntu 20.04.
* Added Ubuntu 20.04 to the travis build.
* Removed Ubuntu 16.04 from the travis build.

-- Matthias Lüscher (Launchpad) <m.luescher@datacomm.ch> Fri, 21 Feb 2020 16:10:43 +0100

edi (1.2.0) bionic; urgency=medium

[ Matthias Lüscher ]
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
# built documents.
#
# The short X.Y version.
version = '1.2.0'
release = '1.2.0'
version = '1.2.1'
release = '1.2.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion edi/lib/versionhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# The do_release script will update this version!
# During launchpad debuild neither the git version nor the package version is available.
edi_fallback_version = '1.2.0'
edi_fallback_version = '1.2.1'


def get_edi_version():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
setup(
name='edi',

version='1.2.0',
version='1.2.1',

description='Embedded Development Infrastructure - edi',
long_description=long_description,
Expand Down
10 changes: 5 additions & 5 deletions tests/commands/imagecommands/test_image_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# along with edi. If not, see <http://www.gnu.org/licenses/>.


from tests.libtesting.optins import requires_lxc, requires_ansible, requires_debootstrap, requires_sudo
import pytest
from tests.libtesting.contextmanagers.workspace import workspace
import os
from tests.libtesting.helpers import get_random_string, get_project_root, suppress_chown_during_debuild
Expand All @@ -33,10 +33,10 @@
import subprocess


@requires_lxc
@requires_ansible
@requires_debootstrap
@requires_sudo
@pytest.mark.requires_lxc
@pytest.mark.requires_ansible
@pytest.mark.requires_debootstrap
@pytest.mark.requires_sudo
def test_create_buster_image(capsys):
print(os.getcwd())
with workspace():
Expand Down
10 changes: 5 additions & 5 deletions tests/commands/lxccommands/test_lxcconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# along with edi. If not, see <http://www.gnu.org/licenses/>.


from tests.libtesting.optins import requires_lxc, requires_ansible, requires_debootstrap, requires_sudo
import pytest
from tests.libtesting.contextmanagers.workspace import workspace
import os
from tests.libtesting.helpers import get_random_string, get_project_root
Expand Down Expand Up @@ -87,10 +87,10 @@ def get_container_ip_addr(container_name, interface):
return re.findall(r'^\s*inet\s([0-9\.]*)/.*', raw_ip_result, re.MULTILINE)[0]


@requires_lxc
@requires_ansible
@requires_debootstrap
@requires_sudo
@pytest.mark.requires_lxc
@pytest.mark.requires_ansible
@pytest.mark.requires_debootstrap
@pytest.mark.requires_sudo
def test_build_stretch_container(capsys, datadir):
with workspace():
edi_exec = os.path.join(get_project_root(), 'bin', 'edi')
Expand Down
4 changes: 2 additions & 2 deletions tests/commands/test_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
from tests.libtesting.contextmanagers.workspace import workspace
from edi.commands.clean import Clean
from tests.libtesting.helpers import suppress_chown_during_debuild
from tests.libtesting.optins import requires_lxc
import pytest


@requires_lxc
@pytest.mark.requires_lxc
def test_clean_empty_config(empty_config_file, monkeypatch):
suppress_chown_during_debuild(monkeypatch)
with workspace():
Expand Down
24 changes: 24 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# You should have received a copy of the GNU Lesser General Public License
# along with edi. If not, see <http://www.gnu.org/licenses/>.

import pytest
from pytest import fixture
import os
from edi.lib.helpers import copy_tree, get_user, get_hostname
Expand All @@ -37,6 +38,29 @@ def pytest_addoption(parser):
help="include tests that rely on flake8 availability")


def pytest_configure(config):
config.addinivalue_line("markers", "requires_lxc: mark test as requiring lxc to run")
config.addinivalue_line("markers", "requires_ansible: mark test as requiring ansible to run")
config.addinivalue_line("markers", "requires_debootstrap: mark test as requiring debootstrap to run")
config.addinivalue_line("markers", "requires_flake8: mark test as requiring flake8 to run")
config.addinivalue_line("markers", "requires_sudo: mark test as requiring sudo to run")


def pytest_collection_modifyitems(config, items):
for item in items:
if "requires_lxc" in item.keywords and not (config.getoption("--lxc") or config.getoption("--all")):
item.add_marker(pytest.mark.skip(reason="requires --lxc or --all option to run"))
if "requires_ansible" in item.keywords and not (config.getoption("--ansible") or config.getoption("--all")):
item.add_marker(pytest.mark.skip(reason="requires --ansible or --all option to run"))
if "requires_debootstrap" in item.keywords and not (config.getoption("--debootstrap") or
config.getoption("--all")):
item.add_marker(pytest.mark.skip(reason="requires --debootstrap or --all option to run"))
if "requires_flake8" in item.keywords and not (config.getoption("--flake8") or config.getoption("--all")):
item.add_marker(pytest.mark.skip(reason="requires --flake8 or --all option to run"))
if "requires_sudo" in item.keywords and os.getuid() != 0:
item.add_marker(pytest.mark.skip(reason="requires sudo privileges to run"))


@fixture
def datadir(tmpdir, request):
'''
Expand Down
7 changes: 3 additions & 4 deletions tests/lib/test_lxchelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import pytest
from contextlib import contextmanager
from edi.lib.helpers import FatalError
from tests.libtesting.optins import requires_lxc
from edi.lib.lxchelpers import (get_server_image_compression_algorithm,
get_file_extension_from_image_compression_algorithm,
get_lxd_version, LxdVersion)
Expand All @@ -33,7 +32,7 @@
from tests.libtesting.contextmanagers.mocked_executable import mocked_executable, mocked_lxd_version_check


@requires_lxc
@pytest.mark.requires_lxc
def test_get_server_image_compression():
result = get_server_image_compression_algorithm()
assert result in ['bzip2', 'gzip', 'lzma', 'xz', 'none']
Expand Down Expand Up @@ -71,7 +70,7 @@ def test_get_file_extension_from_image_compression_algorithm_failure():
assert '42' in str(e)


@requires_lxc
@pytest.mark.requires_lxc
def test_get_lxd_version():
version = get_lxd_version()
assert '.' in version
Expand All @@ -86,7 +85,7 @@ def clear_lxd_version_check_cache():
LxdVersion(clear_cache=True)


@requires_lxc
@pytest.mark.requires_lxc
def test_lxd_version_check():
with clear_lxd_version_check_cache():
check_method = LxdVersion.check
Expand Down
3 changes: 1 addition & 2 deletions tests/lib/test_shellhelpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from tests.libtesting.helpers import (get_random_string, suppress_chown_during_debuild, get_command,
get_sub_command, get_command_parameter)
from edi.lib.helpers import get_artifact_dir, create_artifact_dir, FatalError
from tests.libtesting.optins import requires_sudo
from edi.lib.shellhelpers import mockablerun
import subprocess

Expand Down Expand Up @@ -61,7 +60,7 @@ def test_artifacts_folder_removal(monkeypatch):
assert not os.path.isdir(abs_dir_name)


@requires_sudo
@pytest.mark.requires_sudo
def test_artifacts_folder_removal_as_sudo():
with workspace() as workdir:
create_artifact_dir()
Expand Down
54 changes: 0 additions & 54 deletions tests/libtesting/optins.py

This file was deleted.

4 changes: 2 additions & 2 deletions tests/test_flake8.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
# You should have received a copy of the GNU Lesser General Public License
# along with edi. If not, see <http://www.gnu.org/licenses/>.

from tests.libtesting.optins import requires_flake8
import pytest
from edi.lib.shellhelpers import run
import os
import subprocess


@requires_flake8
@pytest.mark.requires_flake8
def test_flake8():
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
cmd = ['flake8', '--max-line-length=120', path]
Expand Down

0 comments on commit 8716da5

Please sign in to comment.