-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug in retries logic was fixed (#141)
* * Bug in retries logic was fixed. The client didn't report if a test failed after retries. We should clean failed Test hashmap after the retries count exceed * New tests was added * * Logic was fixed with tests according to internal code review.
- Loading branch information
Showing
4 changed files
with
80 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/test/java/com/github/invictum/reportportal/SuiteStorageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.github.invictum.reportportal; | ||
|
||
import io.reactivex.Maybe; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
public class SuiteStorageTest { | ||
|
||
SuiteStorage storage; | ||
|
||
@Before | ||
public void setupStorage() { | ||
storage = new SuiteStorage(); | ||
storage.start("suite", Maybe::empty); | ||
} | ||
|
||
|
||
@Test | ||
public void testAddNewFail() { | ||
storage.addNewFail("suite", "storage"); | ||
Assert.assertTrue(storage.isFailPresent("suite", "storage")); | ||
} | ||
|
||
@Test | ||
public void testIncrementRetiresCount() { | ||
storage.addNewFail("suite", "storage"); | ||
Assert.assertEquals(1, storage.incrementAndGetRetriesCount("suite", "storage")); | ||
Assert.assertEquals(2, storage.incrementAndGetRetriesCount("suite", "storage")); | ||
Assert.assertEquals(3, storage.incrementAndGetRetriesCount("suite", "storage")); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters