Commit Graph

18 Commits

Author SHA1 Message Date
Henning Schild
0672592768 tests: introduce fixture to change back to right dir
Tests changing the working directory could leave us stranded somewhere
where all following tests could fail. Make sure to always go back on
failure.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-07-07 11:48:57 +02:00
Jan Kiszka
839c936abb Fix flake8 style reports
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-06-17 08:09:14 +02:00
Paul Barker
c2bbfee8f3 tests: Check refspec switch updates git branch/commit correctly
Mercurial has no concept of a local tracking branch so we only need to
test git repositories here.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-06-17 07:58:44 +02:00
Paul Barker
23277836c4 tests: Check patches can still be applied after switching refspec
Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-06-15 19:53:59 +02:00
Paul Barker
79bfe5a04d tests: Return to kas directory when test_patch finishes
This prevents subseqent tests from starting in the wrong directory.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2020-06-15 19:53:54 +02:00
Henning Schild
e29035407f tests: test patching of symbolic refspecs i.e branches
That once caused issues when rolling back (checkout) since our local
branch we patched and commited on had the desired name.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2019-09-25 10:14:22 +02:00
Henning Schild
acc60f4f3a tests: make sure patches can create executables
Create a 755 file in a git and an hg repo, using a patch. Later make
sure the permissions are as expected.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2019-09-21 12:49:53 +02:00
Henning Schild
fafc017392 tests: add a testcase for applying patches
This adds a test where we clone a git and a hg repo and apply a single
patch and later a quilt series on each of them.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2019-08-20 17:54:15 +02:00
Daniel Wagner
25bc0c9c06 scripts: Remove pylint
pylint has been a great tool to get the initial code base into shape
but since then we mostely false postives. All those warnings needed to
be annonated.

This allong wouldn't be reason enough to remove it. The main problem
is that the pylint version on gitlab is updated in the back and
suddenly we get new warnings which are bogus.

Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>
2018-12-07 09:55:26 +01:00
Andreas Reichel
10cd13cf9c Correct grammar, spelling and copyright year in files
Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
2018-09-05 12:46:35 +02:00
Jan Kiszka
d4a615bb0b Command line based configuration file merge
This extends the command line syntax for specifying configuration files.
You can now combine files by concatenating them, separated by colons:

kas build base.yml:board.yml:feature.yml

The motivation for this feature is to avoid having to write tons of
configuration files that perform this combinations statically via
includes.

In order to avoid complications and prevent that users shoot themselves
too easily into their feet, we deny the case of distributing the
configuration files over multiple repositories. Either all files
specified on the command line come from the same repo, or they are all
local (without versioning control).

Based on idea by Claudius Heine.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2018-08-27 07:54:32 +02:00
Jan Kiszka
5c28272d73 includehandler: Fold GlobalIncludes into IncludeHandler class
No user for this abstraction in sight.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2018-08-27 07:48:08 +02:00
Daniel Wagner
9fc8c7735c test_includehandler: Fix indention
pylint reports

tests/test_includehandler.py:343:0: C0330: Wrong hanging indentation before block (add 4 spaces).
            'x.yml': header.format('''  includes: ["y.yml", "z.yml"]
            ^   | (bad-continuation)
tests/test_includehandler.py:345:0: C0330: Wrong hanging indentation before block (add 4 spaces).
            os.path.abspath('y.yml'): header.format('''  includes: ["z.yml"]
            ^   | (bad-continuation)
tests/test_includehandler.py:347:0: C0330: Wrong hanging indentation before block (add 4 spaces).
            os.path.abspath('z.yml'): header.format('''
            ^   | (bad-continuation)

Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>
2018-07-18 16:26:47 +02:00
Daniel Wagner
f60a8b4e6d test_includehandler: Remove useless object inheritanc
Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>
2018-07-18 16:26:47 +02:00
Daniel Wagner
c1e5c4f379 build: Fix all style reports by pycodestyle v2.4.0
pycodestyle v2.4.0 checks for W606 (async deprecated), but
we can't disable it on source code level with '# noqa'. Let's disable
the check globaly. We will still catch it with pylint.

By disabling the W606 we need also to list the W503 which was
previously active.

While at it fix following things:

./docs/conf.py:252:6: E121 continuation line under-indented for hanging indent
./docs/conf.py:257:6: E126 continuation line over-indented for hanging indent
./kas/build.py:123:17: W504 line break after binary operator
./kas/configschema.py:48:25: E123 closing bracket does not match indentation of opening bracket's line
./kas/configschema.py:49:21: E123 closing bracket does not match indentation of opening bracket's line
./tests/test_includehandler.py:82:13: E123 closing bracket does not match indentation of opening bracket's line
./tests/test_includehandler.py:121:13: E123 closing bracket does not match indentation of opening bracket's line

Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>
2018-05-17 13:00:26 +02:00
Claudius Heine
75fa095aa5 config: Added schema validation for configuration files
Currently many of the error messages regarding the configuration file
are not really helpful.

To improve reporting this patch adds validation of the configuration
files using the jsonschema module.

Example:

  Forgetting ':' at the end of a layer definition, like this:

    repos:
      meta-iot2000:
        layers:
          meta-iot2000-example
                              ^

  Exception before:

    TypeError: string indices must be integers

  Exception after:

    Validation Error:
     'meta-iot2000-example' is not of type 'object'

     Failed validating 'type' in schema['properties']['repos']['additionalProperties']['properties']['layers']:
         {'additionalProperties': {'oneOf': [{'type': 'null'},
                                             {'type': 'integer'},
                                             {'type': 'boolean'},
                                             {'type': 'string'}]},
          'type': 'object'}

     On instance['repos']['meta-iot2000']['layers']:
         'meta-iot2000-example'

This patch adds 'jsonschema' as an additional dependency.

Signed-off-by: Claudius Heine <ch@denx.de>
2017-10-13 14:11:10 +02:00
Jan Kiszka
2a618686f1 Switch to separate config file version
Use a separately incremented integer to track the configuration file
format version. We start with 2 due to the change that 23c3a951f6
introduced. 1 is declared to be equivalent to the original '0.10'.

The separate versioning has the advantage of being able to increment it
already during the development cycle, and using it with config files
that test/exploit the new format.

Using an integer has the advantages of a) differentiating it clearly
from the now independent kas version and b) simplifying the version
parsing. We can now also remove the string type restriction.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-07-20 15:31:23 +02:00
Claudius Heine
a482a86eb0 tests/includehandler: added initial tests for includehandler
Signed-off-by: Claudius Heine <ch@denx.de>
2017-07-07 16:56:49 +02:00