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

Refactor: add swappable writer to have in-memory results in testing #39

Merged
merged 2 commits into from
Aug 22, 2019

Conversation

just-boris
Copy link
Contributor

@just-boris just-boris commented Aug 22, 2019

Context

This is a preparation to fix #37 and #38. Per discussion with @baev we need to update testing infra first. This PR does that

Summary

  • Updated tsconfig.json, remove the odd part about type roots, see individual commit for more details: 1dc4ac3

  • Extracted AllureWriter interface from AllureRuntime, create two implementations, default and in-memory

  • Updated all adapters to support the new writer option

  • Replaced GlobalInfoWriter with new methods to support swappable writers

Checklist

const mocha = new Mocha();
mocha.reporter(MochaAllureReporter, { writer });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here are the changes in a nutshell. Now it is possible to provide a custom writer implementation via options and redirect all output somewhere else.

Copy link
Member

@baev baev left a comment

Choose a reason for hiding this comment

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

can we generate allure report for tests? In jenkinsfile you need to add

post {
        always {
            allure results: [[path: '**/build/allure-results']]
            deleteDir()
        }
    }

see https://github.com/allure-framework/allure-java/blob/master/Jenkinsfile as the reference

@just-boris
Copy link
Contributor Author

@baev what report? Since we are writing everything to memory, there are no files to generate a report

If you asked about running unit tests with the reporter enabled here, it would require more work about adding and configuring mocha-multi. Too much for the current PR

@just-boris just-boris merged commit d3fa585 into allure-framework:master Aug 22, 2019
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.

Allure-mocha is not compatible with --check-leaks option
3 participants