Commit Graph

20 Commits

Author SHA1 Message Date
Vsevolod Fedorov 60e8395c62 Add source location and context to error messages
Change-Id: I2e955c01b71a195bb6ff8ba2bb6f3a64cb3e1f58
2023-04-04 13:35:42 +03:00
Vsevolod Fedorov fbd53732b3 Tests: Add tests for duplicate views
Change-Id: I7284e15ec224021c4dfa72e8a70632f3ce8d8d3e
2023-01-26 11:11:13 +03:00
Vsevolod Fedorov f7c6e4f43d Tests: Use job-template instead of job for duplicate tests
In new expander implementation, job entries inside projects are just
ignored.

Change-Id: I4576bc720cef159a549944b5d7638e40ef430299
2023-01-26 11:07:43 +03:00
Vsevolod Fedorov f4d64f9f66 Move tests to pytest
Pytest makes each scenario into individual selectable test.
To be able to run each scenario separately is very useful for development.

Change-Id: I4b1c990a1fd839ce327cd7faa27159a9b9632fed
2022-12-20 10:44:43 +03:00
Thanh Ha 4d90c187a9 Auto-generated output from python-black
Please review the following patch containing the code changes in
the repo. This patch is a transition patch and is the auto-generated
output of the python-black tool.

Change-Id: I2d2de71da8a105fb62b561899ae78441ddab4032
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
2019-09-09 19:23:24 +01:00
Sorin Sbarnea c2781e670f
Normalize newlines at end of file
Preparatory move for adopting pre-commit hooks.
Shoudl only remove newlines and spaces at end of files.

Change-Id: Ia33679467c533722b9308f7e7b74be395c926428
Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2018-06-29 16:07:06 -04:00
Darragh Bailey 4573b3a25d Refactor base test classes inheritance for reuse
Refactor base test class inheritance to allow for BaseTest class to be
reused without needing to also import the TestCase class everywhere in
order to avoid having the common test function executed on base classes.

This makes it easier to build base testing classes and then simplifies
the subclassing of these for actual tests.

Change-Id: I89809e8082469f814f245db4a9ab7658aac8a405
2016-09-14 14:58:57 +01:00
Jeff Grafton cdfeb7bf66 Update Git SCM so that extensions are configured correctly.
Many configuration options have been extensions for at least 2 years, so
update the generated XML to actually configure these options.

Change-Id: Ic22ca4a6b8d61c977979a5eb63a2e884dc4391bd
2016-06-06 13:35:04 -07:00
Darragh Bailey 8805a34c0f Reorder imports to match hacking guidelines
Ensure that the imports follow the standard OpenStack hacking
guidelines.

Change-Id: Iaa4326aef118ddfd807dd006934f1d9ca80a1cfa
2015-12-23 15:23:42 -08:00
Darragh Bailey 9bfbffa559 Capture logs with FakeLogging Fixture
Capture logs to attach them on exceptions to simplify the debugging of
errors in tests when they occur.

Change-Id: I5c1b5c306aba37789a8d41eabf65e0ac628af838
2015-09-30 16:25:22 +01:00
Darragh Bailey e5738d0852 Allow whitespace to be significant
Remove the test options suppressing ignoring differences in whitespace
outputted in the XML to allow capturing of issues where the code
incorrectly adds or removes significant whitespace.

Add a helper function to deal with the edge case of parsing XML directly
that contains non significant whitespace to avoid accidentally adding
excess whitespace when minidom outputs the resulting document.

Change-Id: I9936042cd82c204ba2b3c19f575703e33564f7fd
2015-08-11 18:31:48 +01:00
Darragh Bailey 2338167e4e Treat non-existant output files as empty files
Replace requiring empty files for tests that produce no output and treat
any non-existant output file candidate as though the output is blank.

This simplifies tests that are intended to trigger exceptions and will
not generate an output.

Change-Id: I978fdabb488bc3e4bc6f22db294d21ca5d68913b
2015-03-23 16:33:41 +00:00
Wayne b854bef68e Implement recursive search for test fixtures.
This allows hierarchical organization of test scenarios which I consider an
improvement over the current setup.

Change-Id: I079bfa984832e991712099e0ed353d7c2470dc5b
2015-02-05 14:01:29 -08:00
Jenkins 960d5c8524 Merge "Update SCM Git Clean configuration to use new extensions style" 2015-02-04 03:05:07 +00:00
Jenkins d679033a1e Merge "Update SCM Wipe workspace to use extensions style" 2015-02-04 03:04:12 +00:00
Thanh Ha 7d44c58aa2 Update SCM Git Clean configuration to use new extensions style
Use the extensions style configuration for setting the SCM Git clean
configuration. With this format we deprecate the older (clean: bool)
configuration format and replace it with this format:

clean:
    after: bool
    before: bool

The older configuration is still supported so users who did not update
their YAML files can upgrade without updating all their YAML files first.

Change-Id: I1cfc0e2951c2b4de5e67bcb8abdf0b8c070e7fc6
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2015-02-03 21:52:20 -05:00
Thanh Ha d7c37c89a8 Update SCM Wipe workspace to use extensions style
Use the newer extensions style configuration for the SCM Wipe workspace
option. This change simply changes the output style of this
configuration leaving the original YAML configuration values in tact so
it is backwards compatible with the old style configuration for
wipe-workspace setting.

While this patch still sets the old <wipeOutWorkspace> value long with
the new extensions value. Jenkins appears to be happy with both values
present and prefers the extensions format if it exists. This should
allow the older Jenkins that only supports the older config format to
continue to work.

Change-Id: Ib5b1809d19a35f83f524ee84b18f0c58b851c70b
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
2015-02-03 21:49:57 -05:00
Jeremy Stanley fbd432a0ad Use mock in a Python 3.4 compatible way
Related to https://code.google.com/p/mock/issues/detail?id=234

Change-Id: I85549fdba7b9cb575850a12d52e1ffb0d2dba8c0
2015-01-29 23:07:53 +00:00
Kyle Rockman 009b362968 add support to git for changelog against branch
added support for another extension type, and fix how extensions are populated to xml

Change-Id: Ic9cf21a268d4ee3fb9b9efdee65c3d49e0cdb31e
Signed-off-by: Kyle Rockman <kyle.rockman@mac.com>
2014-11-21 08:14:37 -06:00
Darragh Bailey 38c977ceff Error on duplicate job names being found
When parsing yaml files, any duplicate macros, job-templates, job-groups
or jobs should be considered an error by default, but provide a config
option for this to be ignored.

Need to check for seen jobs twice, when processing job groups listed
under projects and again the jobs have been generated from templates.
Use a set and store each job name generated and check on the next
iteration.

Finally walk the list of generated jobs and check if any duplicates are
encountered.

Also ensure that if the user wishes for duplicates to be ignored that
the last defined job replaces the earlier one.

Change-Id: Id31ef33ae1b2469f7c3eeabe77420377978fa35e
2014-09-30 17:55:23 +01:00