Skip to content

Commit

Permalink
test: using github actions with pytest
Browse files Browse the repository at this point in the history
Time to move to Github actions along with updating our tests to pytest.

nose is not maintained anymore, and fails with python 3.10. Time to move to
pytest.
  • Loading branch information
0xc0170 committed Feb 28, 2022
1 parent 34d9d7b commit af48d88
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 27 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- "3.10"

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade setuptools pip wheel
pip install -e .[test]
- name: Test build
run: |
python setup.py sdist bdist_wheel
- name: Test with pytest
run: |
pip install -r tests/requirements.txt
pytest --junitxml=test-results-${{ matrix.python-version }}.xml --cov=project_generator --cov-report=xml
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
coverage
coveralls
pytest
pytest-cov
10 changes: 5 additions & 5 deletions tests/test_commands/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import shutil

from unittest import TestCase
from nose.tools import *
import pytest

from project_generator.commands import build
from .simple_project import project_1_yaml, projects_yaml, project_2_yaml
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_build_project_iar_arm_tool(self):
# CI does not have IAR ARM tool installed should fail , or even a project is not valid
assert result == -1

@raises(NotImplementedError)
@pytest.mark.xfail(raises=NotImplementedError)
def test_build_project_coide_tool(self):
args = self.parser.parse_args(['build','-f','test_workspace/projects.yaml','-p',
'project_2', '-t', 'coide'])
Expand All @@ -108,19 +108,19 @@ def test_build_project_make_armcc_tool(self):

assert result == -1

@raises(NotImplementedError)
@pytest.mark.xfail(raises=NotImplementedError)
def test_build_project_eclipse_tool(self):
args = self.parser.parse_args(['build','-f','test_workspace/projects.yaml','-p',
'project_2', '-t', 'eclipse_make_gcc_arm'])
result = build.run(args)

@raises(NotImplementedError)
@pytest.mark.xfail(raises=NotImplementedError)
def test_build_project_gdb_tool(self):
args = self.parser.parse_args(['build','-f','test_workspace/projects.yaml','-p',
'project_2', '-t', 'gdb'])
result = build.run(args)

@raises(NotImplementedError)
@pytest.mark.xfail(raises=NotImplementedError)
def test_build_project_arm_none_eabi_gdb_tool(self):
args = self.parser.parse_args(['build','-f','test_workspace/projects.yaml','-p',
'project_2', '-t', 'arm_none_eabi_gdb'])
Expand Down
1 change: 0 additions & 1 deletion tests/test_commands/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import shutil

from unittest import TestCase
from nose.tools import *

from project_generator.commands import init

Expand Down
1 change: 0 additions & 1 deletion tests/test_tools/test_coide.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import shutil

from unittest import TestCase
from nose.tools import *

from project_generator.generate import Generator
from project_generator.project import Project
Expand Down
1 change: 0 additions & 1 deletion tests/test_tools/test_iar.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import shutil

from unittest import TestCase
from nose.tools import *

from project_generator.generate import Generator
from project_generator.project import Project
Expand Down
1 change: 0 additions & 1 deletion tests/test_tools/test_uvision.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import shutil

from unittest import TestCase
from nose.tools import *

from project_generator.generate import Generator
from project_generator.project import Project
Expand Down
1 change: 0 additions & 1 deletion tests/test_tools/test_uvision5.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import shutil

from unittest import TestCase
from nose.tools import *

from project_generator.generate import Generator
from project_generator.project import Project
Expand Down
1 change: 0 additions & 1 deletion tests/test_tools/test_visualstudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import shutil

from unittest import TestCase
from nose.tools import *

from project_generator.generate import Generator
from project_generator.project import Project
Expand Down

0 comments on commit af48d88

Please sign in to comment.