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

Fix extra report folders creation #1498

Merged
merged 8 commits into from
Nov 22, 2021
Merged

Conversation

Eldarian
Copy link
Contributor

@Eldarian Eldarian commented Nov 5, 2021

Fixes #1488

Added functionality that creates test report folder on test start manually. testDirectory is now InheritableThreadLocal variable. When there is a new thread created while test runs, initial value of testDirectory is the same as at the parent thread.
ThreadLogAppender now checks does bufferedWriter logs to current test directory.

Info logs work correctly, in debug log layer I found that some extra folders still arriving: for example, OnAfterClass (because TestLogAppender has already closed) and for running shutdown hook (because this log appears from special thread)

@@ -128,6 +128,9 @@ public void onStart(ITestContext context) {

@Override
public void onTestStart(ITestResult result) {
// create new folder for test report
ReportContext.createNewTestDir();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather incorrect method naming... it doesn't generate new test dir)

@@ -473,6 +473,12 @@ public static void emptyTestDirData() {
closeThreadLogAppender();
}

public static void createNewTestDir() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this method?

@Eldarian Eldarian closed this Nov 9, 2021
@Eldarian Eldarian reopened this Nov 9, 2021
@@ -128,7 +128,10 @@ public void onStart(ITestContext context) {

@Override
public void onTestStart(ITestResult result) {
// create new folder for test report
ReportContext.createNewTestDir(StringUtils.EMPTY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. rename to createTestDir
  2. implement 2 methods: one without args -> UUID for naming, and with actual parameter

@vdelendik vdelendik merged commit 2e32762 into zebrunner:master Nov 22, 2021
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

Successfully merging this pull request may close these issues.

Extra report folders creation
2 participants