question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PiranhaJava - Unable to remove stale Unit Test code

See original GitHub issue

Hi,

I’m defining an annotation :

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface FlagTesting {
    MyClass.TestExperimentName[] treated();
}

and using it in my unit test :

@Test
@FlagTesting(treated = MyClass.TestExperimentName.SAMPLE_STALE_FLAG)
public void addition_isCorrect() throws Exception {
...
}

When I build this, although the flag and its corresponding methods in the product code get removed as expected, unit test build fails with the error :

Execution failed for task ':app:compileInternalChromeBeta64DebugUnitTestJavaWithJavac'.
> Piranha is not a valid checker name

Any pointers on why this might happen will be really great.

PS : Using this on Android code that uses gradle.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mkr-plsecommented, Jun 2, 2020

Fixed in #45.

1reaction
mkr-plsecommented, Jun 2, 2020

It doesn’t do anything special now and will soon be removed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing Piranha: An Open Source Tool to Automatically ...
Seeking to automate this process, we developed Piranha, a tool that scans source code to delete code related to stale, or obsolete, ...
Read more >
Trying to unit test a method and I'm unable to get rid of a ...
I'm using JUnit 5 and Pitest 1.6.2, and I'm trying to unit test the following ...
Read more >
Test Explorer shows and cannot remove
Test Explorer is displaying the tests in a project that has been removed from the solution, and I cannot get rid of it....
Read more >
When should you remove or change a unit test? - Roy Osherove
They are there to make sure that when we change code we don t break ... But sometimes we might get some failing...
Read more >
Unit Tests, How to Write Testable Code, and Why It Matters
Both the unit test and the system under test should not access the network resources, databases, file system, etc., to eliminate the influence...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found