[Asterisk-code-review] Added Debug Message for Test Objects Configured as Base Type (testsuite[master])

Ashley Sanders asteriskteam at digium.com
Fri Dec 11 16:55:13 CST 2015


Ashley Sanders has posted comments on this change.

Change subject: Added Debug Message for Test Objects Configured as Base Type
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.asterisk.org/#/c/1775/1/lib/python/asterisk/test_runner.py
File lib/python/asterisk/test_runner.py:

Line 323:     from test_case import TestCase
        : 
        :     if type(test_object) == TestCase:
        :         LOGGER.debug(
        :             "**Possible Test Misconfiguration: The test has been configured "
        :             "to instantiate a type of 'test_case.TestCase' as its "
        :             "test-object; however, this type is the base type for the Python "
        :             "tests and not a pluggable module. Did you mean to use "
        :             "'test_case.TestCaseModule?'")
> This code change limits us to only TestCase derived test objects. When the 
This code doesn't limit anything. It says that if the type that was requested in the YAML was 'test_case.TestCase' (the base type), to display a debug message in the log.

This message will not emit unless the most immediate type is 'test_case.TestCase', so derived types, like 'test_case.TestCaseModule' and custom types, will not trigger the message.

The issue that was encountered in the original issue (the reason this exists) was because of a misconfiguration. The type being requested was meant to be 'test_case.TestCaseModule'. This lead to the original developer going down a long and winding path trying to determine why the test was running but not running.

To be certain that we never actually use 'test_case.TestCase' as a test-object type, I did some digging in our testsuite and not once did I find an instance where we preferred 'test_case.TestCase' over a derived type.

I realized when I implemented this that it wasn't the most robust solution, but the issue that I opened wasn't really to do anything more invasive than output a debug message. Obviously, I never expected to receive this kind of feedback for including the message or else I would not used this approach. Since this seems to diverge too much from the original intention of the code, I will be happy to abandon this change.


-- 
To view, visit https://gerrit.asterisk.org/1775
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8a16d2f43ae5944680ba393f39bdb80f5df79e07
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list