RedHatQE / polarize

GNU General Public License v3.0
2 stars 2 forks source link

Doubling up on generating testcases with TestCase Importer #43

Closed rarebreed closed 7 years ago

rarebreed commented 7 years ago

I found several problems with the TestCase importer. The first is while doing something like this:

@TestDefinition( projectID = {Project.RHEL6, Project.RedHatEnterpriseLinux7} 
                            , testCaseID = {"", ""})
public void foo() {

}

It would generate 2 RedHatEnterpriseLinux7 TestCases instead of one.

rarebreed commented 7 years ago

This was being caused due to reuse of a Testcases object. In the TestDefinitionProcessor object, it has a field called this.testcases. Inside the Testcases object was a list of Testcase. Since this object was being reused from this.testcase, and being used in initTestcases, each time initTestcases got called, it would use the now mutated value.

Solution is to not use this.testcases at all, and just pass in a fresh Testcases object to initTestcases.

rarebreed commented 7 years ago

Fixed in e08ee96