[Tests] Separated independent tests

- Tests that doesn't depend on the KiCad version
- So they aren't run 6, 8 or even more times
- Hopefuly will reduce download issues in dep tests
This commit is contained in:
Salvador E. Tropea 2023-04-18 07:31:42 -03:00
parent 0d503479eb
commit 43a2bea49d
9 changed files with 196 additions and 14 deletions

View File

@ -40,12 +40,6 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --statistics
- name: Test ${{ matrix.ki_release }}
env:
KI_RELEASE: ${{ matrix.ki_release }}
@ -111,10 +105,72 @@ jobs:
#echo Disabled by now
coveralls
test_indep:
strategy:
fail-fast: false
runs-on: ubuntu-latest
container: ghcr.io/inti-cmnb/kicad_auto_test:latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --statistics
- name: Test Independent
env:
KI_RELEASE: latest
run: |
rm -rf output
rm -f tests/.local
# Ensure we start a fresh coverage meassurement
python3-coverage erase
# Create the caches with macros
python3-coverage run src/kibot --help-outputs > /dev/null
./g4.sh
- name: Store coverage
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: Test_Coverage_Independent
path: .coverage.*
- name: Collect coverage independent
run: |
python3-coverage combine
python3-coverage report
python3-coverage html -d output/htmlcov_independent
- name: Store results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: Test_Output_Independent
# Important! empty directories are skipped!!!!
path: output
- name: Upload Coverage
# Don't mix stable coverage with development coverage
if: github.ref == 'refs/heads/dev'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_FLAG_NAME: independent
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# apt-get update
# apt-get -y install python3-pip
# pip3 install coveralls
#coveralls --service=github
#echo Disabled by now
coveralls
create_images:
name: Triggers the docker images creation
runs-on: ubuntu-latest
needs: test
needs: [test, test_indep]
if: github.ref == 'refs/heads/dev'
steps:
- name: Trigger `dev` images build
@ -124,8 +180,8 @@ jobs:
consolidate_coverage:
name: Consolidate coverage data
runs-on: ubuntu-latest
container: setsoft/kicad_auto_test:ki6
needs: test
container: setsoft/kicad_auto_test:ki7
needs: [test, test_indep]
# Don't mix stable coverage with development coverage
if: github.ref == 'refs/heads/dev'
@ -164,6 +220,11 @@ jobs:
with:
name: Test_Coverage_ki6_g3
- name: Download coverage independent
uses: actions/download-artifact@v3
with:
name: Test_Coverage_Independent
- name: Combine coverage
run: |
pip3 install --upgrade coverage==5.1
@ -180,7 +241,7 @@ jobs:
coveralls:
name: Finish Coveralls
needs: test
needs: [test, test_indep]
runs-on: ubuntu-latest
# Don't mix stable coverage with development coverage
if: github.ref == 'refs/heads/dev'

2
g1.sh
View File

@ -3,4 +3,4 @@ if [ $KI_RELEASE == "nightly" ]; then
export KIAUS_USE_NIGHTLY="7.0"
fi
# Fast tests
pytest-3 -v --durations=0 -m "not slow" -n 2 --test_dir=output
pytest-3 -v --durations=0 -m "not (slow or indep)" -n 2 --test_dir=output

4
g2.sh
View File

@ -4,6 +4,6 @@ if [ $KI_RELEASE == "nightly" ]; then
fi
set -e
# Eeschema tests
pytest-3 -v --durations=0 -m "eeschema" --test_dir=output
pytest-3 -v --durations=0 -m "eeschema and (not indep)" --test_dir=output
# KiCad2Step tests and others
pytest-3 -v --durations=0 -m "slow and (not (pcbnew or eeschema))" --log-cli-level debug --test_dir=output
pytest-3 -v --durations=0 -m "slow and (not (pcbnew or eeschema or indep))" --log-cli-level debug --test_dir=output

2
g3.sh
View File

@ -3,4 +3,4 @@ if [ $KI_RELEASE == "nightly" ]; then
export KIAUS_USE_NIGHTLY="7.0"
fi
# PCBnew tests
pytest-3 -v --durations=0 -m "pcbnew" --test_dir=output
pytest-3 -v --durations=0 -m "pcbnew and (not indep)" --test_dir=output

6
g4.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
if [ $KI_RELEASE == "nightly" ]; then
export KIAUS_USE_NIGHTLY="7.0"
fi
# Independent tests, should be the same for any KiCad version
pytest-3 -v --durations=0 -m "indep" --test_dir=output

View File

@ -6,3 +6,4 @@ markers =
kicad2step: uses kicad2step tool
eeschema: uses eeschema tool
pcbnew: uses pcbnew tool
indep: not for a particular KiCad version

View File

@ -81,6 +81,7 @@ def try_dependency_module(ctx, caplog, monkeypatch, docstring, name_dep, downloa
assert res.__file__ is not None
@pytest.mark.indep
def test_dep_rar(test_dir, caplog, monkeypatch):
""" Check the rar_downloader """
# Create a context to get an output directory
@ -89,6 +90,7 @@ def test_dep_rar(test_dir, caplog, monkeypatch):
@pytest.mark.slow
@pytest.mark.indep
def test_dep_pytool(test_dir, caplog, monkeypatch):
""" Check the pytool_downloader """
# Create a context to get an output directory
@ -98,6 +100,7 @@ def test_dep_pytool(test_dir, caplog, monkeypatch):
@pytest.mark.slow
@pytest.mark.indep
def test_dep_rsvg(test_dir, caplog, monkeypatch):
""" Check the rsvg_downloader """
# Create a context to get an output directory
@ -107,6 +110,7 @@ def test_dep_rsvg(test_dir, caplog, monkeypatch):
try_dependency(ctx, caplog, monkeypatch, downloader.__doc__+dep, 'rsvg', 'rsvg', bin_dir)
@pytest.mark.indep
def test_dep_git(test_dir, caplog, monkeypatch):
""" Check the git_downloader """
# Create a context to get an output directory
@ -117,6 +121,7 @@ def test_dep_git(test_dir, caplog, monkeypatch):
@pytest.mark.slow
@pytest.mark.indep
def test_dep_gs(test_dir, caplog, monkeypatch):
""" Check the git_downloader """
# Create a context to get an output directory
@ -130,6 +135,7 @@ def test_dep_gs(test_dir, caplog, monkeypatch):
# @pytest.mark.xfail(True, reason="URL down", run=True, raises=AssertionError)
# https://imagemagick.org/archive/binaries/magick
@pytest.mark.slow
@pytest.mark.indep
def test_dep_convert(test_dir, caplog, monkeypatch):
""" Check the convert_downloader """
# Create a context to get an output directory
@ -139,6 +145,7 @@ def test_dep_convert(test_dir, caplog, monkeypatch):
try_dependency(ctx, caplog, monkeypatch, downloader.__doc__+dep, 'imagemagick', 'convert', bin_dir)
@pytest.mark.indep
def test_dep_python(test_dir, caplog, monkeypatch):
""" Check the python_downloader """
# Create a context to get an output directory

View File

@ -107,6 +107,7 @@ def run_compress(ctx, test_import_fail=False):
# assert "Missing `rar` command" in caplog.text
@pytest.mark.indep
def test_rar_fail(test_dir, caplog, monkeypatch):
global mocked_check_output_FNF
mocked_check_output_FNF = False
@ -146,6 +147,7 @@ class DummyPre(BasePreFlight):
self._sch_related = True
@pytest.mark.indep
def test_no_get_targets(caplog):
test = NoGetTargets()
test_pre = DummyPre()
@ -161,6 +163,7 @@ def test_no_get_targets(caplog):
assert files_pre == [GS.sch_file]
@pytest.mark.indep
def test_ibom_parse_fail(test_dir, caplog, monkeypatch):
global mocked_check_output_FNF
mocked_check_output_FNF = False
@ -189,6 +192,7 @@ def test_ibom_parse_fail(test_dir, caplog, monkeypatch):
mocked_check_output_retOK = ''
@pytest.mark.indep
def test_var_rename_no_variant():
with context.cover_it(cov):
# Load the plug-ins
@ -200,6 +204,7 @@ def test_var_rename_no_variant():
filter.filter(None)
@pytest.mark.indep
def test_bom_no_sch():
with context.cover_it(cov):
# Load the plug-ins
@ -215,6 +220,7 @@ def test_bom_no_sch():
assert columns == ColumnList.COLUMNS_DEFAULT
@pytest.mark.indep
def test_pre_xrc_fail(test_dir, caplog, monkeypatch):
ctx = context.TestContext(test_dir, 'test_v5', 'empty_zip', '')
global mocked_call_enabled
@ -251,6 +257,7 @@ def test_pre_xrc_fail(test_dir, caplog, monkeypatch):
mocked_call_enabled = False
@pytest.mark.indep
def test_unimplemented_layer(caplog):
with context.cover_it(cov):
with pytest.raises(AssertionError) as e:
@ -259,6 +266,7 @@ def test_unimplemented_layer(caplog):
assert e.value.args[0] == "Unimplemented layer type <class 'int'>"
@pytest.mark.indep
def test_step_fail(test_dir, caplog, monkeypatch):
global mocked_check_output_FNF
mocked_check_output_FNF = False
@ -291,6 +299,7 @@ def test_step_fail(test_dir, caplog, monkeypatch):
mocked_call_enabled = False
@pytest.mark.indep
def test_unknown_prefix(caplog):
with context.cover_it(cov):
get_prefix(1, 'y')
@ -328,6 +337,7 @@ def test_search_as_plugin_fail(test_dir, caplog):
assert fname is None
@pytest.mark.indep
def test_layer_no_id():
with context.cover_it(cov):
la = Layer()
@ -337,6 +347,7 @@ def test_layer_no_id():
assert str(la) == "F.Cu ('Top' F_Cu)"
@pytest.mark.indep
def test_makefile_kibot_sys(test_dir):
ctx = context.TestContext(test_dir, 'test_v5', 'empty_zip', '')
GS.sch_file = 'foo.sch'
@ -348,6 +359,7 @@ def test_makefile_kibot_sys(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_units_1():
with context.cover_it(cov):
# Test for ',' as decimal point
@ -389,6 +401,7 @@ def test_units_1():
assert a.extra['tolerance'] == 1
@pytest.mark.indep
def test_read_resistance():
with context.cover_it(cov):
assert read_resistance("4k7")[0] == D("4700")
@ -410,6 +423,7 @@ def test_read_resistance():
assert read_resistance("4k7000")[0] == D("4700")
@pytest.mark.indep
def test_electro_grammar_1():
with context.cover_it(cov):
C2UF_0603_30P = {'type': 'capacitor', 'capacitance': 2e-6, 'size': '0603', 'tolerance': 30}

View File

@ -48,12 +48,14 @@ For debug information use:
pytest-3 --log-cli-level debug
"""
import pytest
import os
from . import context
from kibot.misc import (EXIT_BAD_CONFIG, PLOT_ERROR, BOM_ERROR, WRONG_ARGUMENTS)
PRJ = 'fail-project'
@pytest.mark.indep
def test_no_version(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_no_version')
ctx.run(EXIT_BAD_CONFIG)
@ -61,6 +63,7 @@ def test_no_version(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_version(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_version')
ctx.run(EXIT_BAD_CONFIG)
@ -68,6 +71,7 @@ def test_wrong_version(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_version_2(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_version_2')
ctx.run(EXIT_BAD_CONFIG)
@ -75,6 +79,7 @@ def test_wrong_version_2(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_version_3(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_version_3')
ctx.run(EXIT_BAD_CONFIG)
@ -82,6 +87,7 @@ def test_wrong_version_3(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_drill_map_no_type_1(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_drill_map_no_type')
ctx.run(EXIT_BAD_CONFIG)
@ -89,6 +95,7 @@ def test_drill_map_no_type_1(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_drill_map_no_type_2(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_drill_map_no_type_2')
ctx.run(EXIT_BAD_CONFIG)
@ -96,6 +103,7 @@ def test_drill_map_no_type_2(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_drill_map_wrong_type_1(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_drill_map_wrong_type')
ctx.run(EXIT_BAD_CONFIG)
@ -103,6 +111,7 @@ def test_drill_map_wrong_type_1(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_drill_map_wrong_type_2(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_drill_map_wrong_type_2')
ctx.run(EXIT_BAD_CONFIG)
@ -110,6 +119,7 @@ def test_drill_map_wrong_type_2(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_drill_map_wrong_type_3(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_drill_map_wrong_type_3')
ctx.run(EXIT_BAD_CONFIG)
@ -117,6 +127,7 @@ def test_drill_map_wrong_type_3(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_drill_report_no_type_1(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_drill_report_no_type')
ctx.run(EXIT_BAD_CONFIG)
@ -124,6 +135,7 @@ def test_drill_report_no_type_1(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_drill_report_no_type_2(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_drill_report_no_type_2')
ctx.run(EXIT_BAD_CONFIG)
@ -131,6 +143,7 @@ def test_drill_report_no_type_2(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_drill_report_wrong_type_2(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_drill_report_wrong_type_2')
ctx.run(EXIT_BAD_CONFIG)
@ -138,6 +151,7 @@ def test_drill_report_wrong_type_2(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_drill_report_wrong_type_3(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_drill_report_wrong_type_3')
ctx.run(EXIT_BAD_CONFIG)
@ -145,6 +159,7 @@ def test_drill_report_wrong_type_3(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_layer_1(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_layer_1')
ctx.run(EXIT_BAD_CONFIG)
@ -152,6 +167,7 @@ def test_wrong_layer_1(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_layer_2(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_layer_2')
ctx.run(PLOT_ERROR)
@ -159,6 +175,7 @@ def test_wrong_layer_2(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_layer_3(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_layer_3')
ctx.run(EXIT_BAD_CONFIG)
@ -166,6 +183,7 @@ def test_wrong_layer_3(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_layer_4(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_layer_4')
ctx.run(EXIT_BAD_CONFIG)
@ -173,6 +191,7 @@ def test_wrong_layer_4(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_layer_5(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_layer_5')
ctx.run(EXIT_BAD_CONFIG)
@ -180,6 +199,7 @@ def test_wrong_layer_5(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_layer_6(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_layer_6')
ctx.run(EXIT_BAD_CONFIG)
@ -187,6 +207,7 @@ def test_wrong_layer_6(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_layer_7(test_dir):
""" List of numbers """
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_layer_7')
@ -195,6 +216,7 @@ def test_wrong_layer_7(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_layer_9(test_dir):
""" A bogus string """
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_layer_9')
@ -203,6 +225,7 @@ def test_wrong_layer_9(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_layer_8(test_dir):
""" List of strings, but number in middle """
ctx = context.TestContext(test_dir, '3Rs', 'error_wrong_layer_8')
@ -211,6 +234,7 @@ def test_wrong_layer_8(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_no_name(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_no_name')
ctx.run(EXIT_BAD_CONFIG)
@ -218,6 +242,7 @@ def test_no_name(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_empty_name(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_empty_name')
ctx.run(EXIT_BAD_CONFIG)
@ -225,6 +250,7 @@ def test_empty_name(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_no_type(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_no_type')
ctx.run(EXIT_BAD_CONFIG)
@ -232,6 +258,7 @@ def test_no_type(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_out_unknown_attr(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_unk_attr')
ctx.run(EXIT_BAD_CONFIG)
@ -239,6 +266,7 @@ def test_out_unknown_attr(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_out_needs_type(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_needs_type')
ctx.run(EXIT_BAD_CONFIG)
@ -247,6 +275,7 @@ def test_out_needs_type(test_dir):
# Now is valid
# @pytest.mark.indep
# def test_no_options(test_dir):
# ctx = context.TestContext(test_dir, '3Rs', 'error_no_options')
# ctx.run(EXIT_BAD_CONFIG)
@ -254,6 +283,7 @@ def test_out_needs_type(test_dir):
# ctx.clean_up()
@pytest.mark.indep
def test_no_layers(test_dir):
ctx = context.TestContext(test_dir, '3Rs', 'error_no_layers')
ctx.run(EXIT_BAD_CONFIG)
@ -261,6 +291,7 @@ def test_no_layers(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_step_origin(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_step_origin')
ctx.run(EXIT_BAD_CONFIG)
@ -268,6 +299,7 @@ def test_error_step_origin(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_step_min_distance(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_step_min_distance')
ctx.run(EXIT_BAD_CONFIG)
@ -275,6 +307,7 @@ def test_error_step_min_distance(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_filter_not_list(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_filter_not_list')
ctx.run(EXIT_BAD_CONFIG)
@ -282,6 +315,7 @@ def test_filter_not_list(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_filter_no_number_1(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_filter_no_number')
ctx.run(EXIT_BAD_CONFIG)
@ -289,6 +323,7 @@ def test_filter_no_number_1(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_filter_no_number_2(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_filter_no_number_2')
ctx.run(EXIT_BAD_CONFIG)
@ -296,6 +331,7 @@ def test_filter_no_number_2(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_filter_no_regex_1(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_filter_no_regex')
ctx.run(EXIT_BAD_CONFIG)
@ -303,6 +339,7 @@ def test_filter_no_regex_1(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_filter_wrong_entry(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_filter_wrong_entry')
ctx.run(EXIT_BAD_CONFIG)
@ -310,6 +347,7 @@ def test_filter_wrong_entry(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_pre_list(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_pre_list')
ctx.run(EXIT_BAD_CONFIG)
@ -317,6 +355,7 @@ def test_error_pre_list(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_pre_unk(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_pre_unk')
ctx.run(EXIT_BAD_CONFIG)
@ -324,6 +363,7 @@ def test_error_pre_unk(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_wrong_type_1(test_dir):
""" run_drc = number """
ctx = context.TestContext(test_dir, PRJ, 'error_pre_wrong_type_1')
@ -332,6 +372,7 @@ def test_error_wrong_type_1(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_wrong_type_2(test_dir):
""" ignore_unconnected = string """
ctx = context.TestContext(test_dir, PRJ, 'error_pre_wrong_type_2')
@ -340,6 +381,7 @@ def test_error_wrong_type_2(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_wrong_type_3(test_dir):
""" run_erc = number """
ctx = context.TestContext(test_dir, PRJ, 'error_pre_wrong_type_3')
@ -348,6 +390,7 @@ def test_error_wrong_type_3(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_wrong_type_4(test_dir):
""" update_xml = number """
ctx = context.TestContextSCH(test_dir, 'bom', 'error_pre_wrong_type_4')
@ -356,6 +399,7 @@ def test_error_wrong_type_4(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_wrong_type_5(test_dir):
""" check_zone_fills = number """
ctx = context.TestContext(test_dir, PRJ, 'error_pre_wrong_type_5')
@ -364,6 +408,7 @@ def test_error_wrong_type_5(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_yaml(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_yaml')
ctx.run(EXIT_BAD_CONFIG)
@ -371,6 +416,7 @@ def test_error_yaml(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_out_not_list(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_out_not_list')
ctx.run(EXIT_BAD_CONFIG)
@ -378,6 +424,7 @@ def test_out_not_list(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_unk_section(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_unk_section')
ctx.run(EXIT_BAD_CONFIG)
@ -385,6 +432,7 @@ def test_unk_section(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_hpgl_pen_num(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_hpgl_pen_num')
ctx.run(EXIT_BAD_CONFIG)
@ -392,6 +440,7 @@ def test_error_hpgl_pen_num(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_bom_wrong_format(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_bom_wrong_format')
ctx.run(EXIT_BAD_CONFIG, no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), 'bom'+context.KICAD_SCH_EXT)])
@ -399,6 +448,7 @@ def test_error_bom_wrong_format(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_bom_column(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_bom_column')
ctx.run(EXIT_BAD_CONFIG, no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), 'bom'+context.KICAD_SCH_EXT)])
@ -406,6 +456,7 @@ def test_error_bom_column(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_bom_no_columns(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_bom_column')
ctx.run(BOM_ERROR, no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(), 'bom_no_xml'+context.KICAD_SCH_EXT)])
@ -413,6 +464,7 @@ def test_error_bom_no_columns(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_bom_no_field(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_bom_no_field')
ctx.run(EXIT_BAD_CONFIG, no_board_file=True, extra=['-e', os.path.join(ctx.get_board_dir(),
@ -421,6 +473,7 @@ def test_error_bom_no_field(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_wrong_boolean(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_wrong_boolean')
ctx.run(EXIT_BAD_CONFIG)
@ -428,6 +481,7 @@ def test_error_wrong_boolean(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_gerber_precision(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_gerber_precision')
ctx.run(EXIT_BAD_CONFIG)
@ -435,6 +489,7 @@ def test_error_gerber_precision(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_wrong_drill_marks_1(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_wrong_drill_marks')
ctx.run(EXIT_BAD_CONFIG)
@ -442,6 +497,7 @@ def test_error_wrong_drill_marks_1(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_print_pcb_no_layer(test_dir):
prj = 'bom'
ctx = context.TestContext(test_dir, prj, 'error_print_pcb_no_layer')
@ -450,6 +506,7 @@ def test_error_print_pcb_no_layer(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_color(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_color')
ctx.run(EXIT_BAD_CONFIG)
@ -457,6 +514,7 @@ def test_error_color(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_wrong_global(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_wrong_global')
ctx.run(EXIT_BAD_CONFIG)
@ -464,6 +522,7 @@ def test_wrong_global(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_goutput_not_string(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_goutput_not_string')
ctx.run(EXIT_BAD_CONFIG)
@ -471,6 +530,7 @@ def test_goutput_not_string(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_unk_global(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_unk_global')
ctx.run(EXIT_BAD_CONFIG)
@ -478,6 +538,7 @@ def test_unk_global(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_int_bom_no_field(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_int_bom_no_field')
ctx.run(EXIT_BAD_CONFIG)
@ -485,6 +546,7 @@ def test_error_int_bom_no_field(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_int_bom_miss_logo(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_int_bom_miss_logo')
ctx.run(EXIT_BAD_CONFIG)
@ -492,6 +554,7 @@ def test_error_int_bom_miss_logo(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_int_bom_miss_style(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_int_bom_miss_style')
ctx.run(EXIT_BAD_CONFIG)
@ -499,6 +562,7 @@ def test_error_int_bom_miss_style(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_int_bom_unknown_style(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_int_bom_unknown_style')
ctx.run(EXIT_BAD_CONFIG)
@ -506,6 +570,7 @@ def test_error_int_bom_unknown_style(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_int_bom_invalid_col(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_int_bom_invalid_col')
ctx.run()
@ -513,6 +578,7 @@ def test_error_int_bom_invalid_col(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_int_bom_logo_format(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_int_bom_logo_format')
ctx.run(EXIT_BAD_CONFIG)
@ -520,6 +586,7 @@ def test_error_int_bom_logo_format(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_var_no_name(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_var_no_name')
ctx.run(EXIT_BAD_CONFIG)
@ -527,6 +594,7 @@ def test_error_var_no_name(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_var_empty_name(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_var_empty_name')
ctx.run(EXIT_BAD_CONFIG)
@ -534,6 +602,7 @@ def test_error_var_empty_name(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_var_wrong_type(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_var_wrong_type')
ctx.run(EXIT_BAD_CONFIG)
@ -541,6 +610,7 @@ def test_error_var_wrong_type(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_var_no_type(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_var_no_type')
ctx.run(EXIT_BAD_CONFIG)
@ -548,6 +618,7 @@ def test_error_var_no_type(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_var_empty_type(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_var_empty_type')
ctx.run(EXIT_BAD_CONFIG)
@ -555,6 +626,7 @@ def test_error_var_empty_type(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_var_no_list(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_var_no_list')
ctx.run(EXIT_BAD_CONFIG)
@ -562,6 +634,7 @@ def test_error_var_no_list(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_fil_no_list(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_fil_no_list')
ctx.run(EXIT_BAD_CONFIG)
@ -569,6 +642,7 @@ def test_error_fil_no_list(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_fil_unknown(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_fil_unknown')
ctx.run(EXIT_BAD_CONFIG)
@ -576,6 +650,7 @@ def test_error_fil_unknown(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_var_unknown(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_unk_variant')
ctx.run(EXIT_BAD_CONFIG)
@ -583,6 +658,7 @@ def test_error_var_unknown(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_wrong_fil_name(test_dir):
ctx = context.TestContextSCH(test_dir, 'links', 'error_wrong_fil_name')
ctx.run(EXIT_BAD_CONFIG)
@ -590,6 +666,7 @@ def test_error_wrong_fil_name(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_pcbdraw_comp_key(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_pcbdraw_comp_key')
ctx.run(EXIT_BAD_CONFIG)
@ -597,6 +674,7 @@ def test_error_pcbdraw_comp_key(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_rot_not_two(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_rot_not_two')
ctx.run(EXIT_BAD_CONFIG)
@ -604,6 +682,7 @@ def test_error_rot_not_two(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_rot_not_number(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_rot_not_number')
ctx.run(EXIT_BAD_CONFIG)
@ -611,6 +690,7 @@ def test_error_rot_not_number(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_rot_no_rotations(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_rot_no_rotations')
ctx.run(EXIT_BAD_CONFIG)
@ -618,6 +698,7 @@ def test_error_rot_no_rotations(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_makefile_wrong_out(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_makefile_wrong_out')
ctx.run(WRONG_ARGUMENTS)
@ -625,6 +706,7 @@ def test_error_makefile_wrong_out(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_no_column_id(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_no_column_id')
ctx.run(EXIT_BAD_CONFIG)
@ -632,6 +714,7 @@ def test_error_no_column_id(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_aggregate_no_file(test_dir):
ctx = context.TestContext(test_dir, 'bom', 'error_aggregate_no_file')
ctx.run(EXIT_BAD_CONFIG)
@ -639,6 +722,7 @@ def test_error_aggregate_no_file(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_aggregate_miss_file(test_dir):
yaml = 'error_aggregate_miss_file'
if context.ki6():
@ -649,6 +733,7 @@ def test_error_aggregate_miss_file(test_dir):
ctx.clean_up()
@pytest.mark.indep
def test_error_wrong_import_type(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_wrong_import_type')
ctx.run(EXIT_BAD_CONFIG)
@ -656,6 +741,7 @@ def test_error_wrong_import_type(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_import_not_str(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_import_not_str')
ctx.run(EXIT_BAD_CONFIG)
@ -663,6 +749,7 @@ def test_error_import_not_str(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_import_miss_file(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_import_miss_file')
ctx.run(EXIT_BAD_CONFIG)
@ -670,6 +757,7 @@ def test_error_import_miss_file(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_error_import_no_outputs(test_dir):
ctx = context.TestContext(test_dir, PRJ, 'error_import_no_outputs')
ctx.run()
@ -677,6 +765,7 @@ def test_error_import_no_outputs(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_same_name_1(test_dir):
""" 2 outputs with the same name in the same file """
ctx = context.TestContext(test_dir, PRJ, 'error_same_name_1')
@ -685,6 +774,7 @@ def test_same_name_1(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_same_name_2(test_dir):
""" Using import, but the 2nd is in the main file """
ctx = context.TestContext(test_dir, PRJ, 'error_same_name_2')
@ -693,6 +783,7 @@ def test_same_name_2(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_same_name_3(test_dir):
""" Using import and the 2nd is from the import """
ctx = context.TestContext(test_dir, PRJ, 'error_same_name_3')
@ -701,6 +792,7 @@ def test_same_name_3(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_extends_1(test_dir):
""" Extend an undefined output """
ctx = context.TestContext(test_dir, PRJ, 'error_extends_1')
@ -709,6 +801,7 @@ def test_extends_1(test_dir):
ctx.clean_up(keep_project=True)
@pytest.mark.indep
def test_pre_list_instead_of_dict(test_dir):
""" Extend an undefined output """
ctx = context.TestContext(test_dir, PRJ, 'error_pre_list_instead_of_dict_issue_360')