Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant debug in IntelliJ with Allure2 and aspectj in my pom.xml #809

Closed
1 of 3 tasks
breinjhel opened this issue Jun 25, 2018 · 7 comments
Closed
1 of 3 tasks

Cant debug in IntelliJ with Allure2 and aspectj in my pom.xml #809

breinjhel opened this issue Jun 25, 2018 · 7 comments

Comments

@breinjhel
Copy link

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

Not sure if this is where I should post this but right now when I try to debug my code using IntelliJ with Allure and aspectj enabled Im getting 'this is not available' in debugger window when I try to evaluate a piece of code. If I remove the aspectj related stuff in pom.xml then debugging works fine

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

What is the expected behavior?

I should be able to debug even with Allure and aspectj in pom.xml

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Allure version 2.6.0
Test framework junit@4.12
Allure adaptor allure-junit4@2.6.0
Generate report using allure-maven@2.6.0
AspectJ version 1.9.1

Other information

@breinjhel
Copy link
Author

breinjhel commented Jun 25, 2018

This is the part in pom.xml I had to comment out so that I can debug in intellij

<?xml version="1.0" encoding="UTF-8"?>
<plugin>
   <artifactId>maven-failsafe-plugin</artifactId>
   <version>2.18</version>
   <configuration>
      <systemProperties>
         <property>
            <name>allure.results.directory</name>
            <value>${project.build.directory}/allure-results</value>
         </property>
         <property>
            <name>allure.link.issue.pattern</name>
            <value>https://example.org/issue/{}</value>
         </property>
      </systemProperties>
      <argLine>-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"</argLine>
      <properties>
         <property>
            <name>listener</name>
            <value>io.qameta.allure.junit4.AllureJunit4</value>
         </property>
      </properties>
      <includes>
         <include>**/*Test.java</include>
         <include>**/When*.java</include>
         <include>**/*Section.java</include>
      </includes>
      <excludes>
         <exclude>**/*IntegrationTest.java</exclude>
      </excludes>
      <reuseForks>true</reuseForks>
      <systemPropertyVariables>
         <geb.build.reportsDir>target/test-reports/geb</geb.build.reportsDir>
      </systemPropertyVariables>
   </configuration>
   <dependencies>
      <dependency>
         <groupId>org.aspectj</groupId>
         <artifactId>aspectjweaver</artifactId>
         <version>${aspectj.version}</version>
      </dependency>
   </dependencies>
   <executions>
      <execution>
         <goals>
            <goal>integration-test</goal>
            <goal>verify</goal>
         </goals>
      </execution>
   </executions>
</plugin>

@breinjhel
Copy link
Author

This happens only when debugging inside the @step methods

@simple-elf
Copy link
Contributor

@breinjhel this happen, because then you run junit tests from IntelliJ IDEA allure junit4 listener is not connected.
But with testng there is no such problem.

My solution is maven profile, that active ONLY then you run test localy from IntelliJ IDEA
https://github.com/simple-elf/selenoid-video-allure/blob/master/junit4/pom.xml

<profiles>
        <profile>
            <id>junit4-aspect</id>
            <activation>
                <!--https://stackoverflow.com/questions/24760387/activate-certain-maven-profile-in-intellij-idea-only-->
                <property>
                    <name>idea.maven.embedder.version</name>
                </property>
                <!--<property><name>idea.version</name></property>-->
            </activation>
            <dependencies>
                <dependency>
                    <groupId>io.qameta.allure</groupId>
                    <artifactId>allure-junit4-aspect</artifactId>
                    <version>${allure.version}</version>
                    <scope>test</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>io.qameta.allure</groupId>
                            <artifactId>allure-junit4</artifactId>
                        </exclusion>
                        <exclusion>
                            <groupId>com.google.guava</groupId>
                            <artifactId>guava</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

@breinjhel
Copy link
Author

@simple-elf I tried doing that but still cant debug/evaluate codes in intellij. Im using the intellij test runner though i run it from intellij not maven so maybe thats why ?

@breinjhel
Copy link
Author

@simple-elf And also can I ask what allure-junit4-aspect is for? Wont the report generate without that just fine?

@breinjhel
Copy link
Author

Im thinking this is due to Aspectj dynamic weaver that was added on v 1.8.7 so everytime i debug while running aspectj i cant evaluate any code in intellij saying 'this is not available'

@baev
Copy link
Member

baev commented Nov 13, 2018

closing because this is not an Allure issue

@baev baev closed this as completed Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants