RedHatQE / polarize

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

Running lein compile or using runtime reflection to create/update clojure test annotations deletes or edits existing entries in the mapping.json #25

Closed rarebreed closed 7 years ago

rarebreed commented 7 years ago

I noticed that if I ran a lein compile, which generates mappings for the rhsm.cli.tests, and then followed that by running the runtime reflection code via:

java -cp $CP -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5009 com.github.redhatqe.polarize.JarHelper \
--jar file:///home/stoner/clean/rhsm-qe/target/sm-1.1.0-SNAPSHOT-standalone.jar \
--packages "rhsm.gui.tests,rhsm.cli.tests"

Then the mapping.json file gets changed drastically. Need to review how the runtime reflection code is different. I tried to make the runtime code use as much as possible with the annotation/compile-time code (which is why a lot of the functions in TestDefinitionProcessor are static), but there are some differences

rarebreed commented 7 years ago

It also appears that when the runtime reflection code is used, it is not grabbing the parameter information. For example, take a look at this:

 "rhsm.cli.tests.ActivationKeyTests.AttemptActivationKeyCreationWithBadNameData_Test" : {
    "RHEL6" : {
      "id" : "RHEL6-21788",
      "parameters" : [ ]
    },
    "RedHatEnterpriseLinux7" : {
      "id" : "RHEL7-51605",
      "parameters" : [ "blockedByBug", "badName" ]
    }
  }

Somehow although for RedHatEnterpriseLinux7 it finds the param info, it doesn't for RHEL6

rarebreed commented 7 years ago

Fixed in https://github.com/RedHatQE/polarize/commit/4aa11434ad47749f81524f976e28603f98fc68ab

rarebreed commented 7 years ago

When I fixed this the first time, I only looked at the runtime reflection code, but the same issue occurs and deletes GUI tests when running lein compile.

rarebreed commented 7 years ago

I think, if I remove the call to the createMappingFile call in process(), the problem will be fixed. There technically should be no reason for that method call (which is super gnarly anyway).

rarebreed commented 7 years ago

I believe this one is fixed with the latest commit as we don't see the missing GUI test cases