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

serenity-cli: when using the --destination flag, default destination folder is created anyway #2454

Open
viper3400 opened this issue May 11, 2021 · 6 comments

Comments

@viper3400
Copy link

Hi,

it seems, that the default destination directory ./target/site/serenity is created, despite of having passed different --source and --destination paths.

Path destination = Paths.get("target/site/serenity");

I attach two *.json test results as they could be produced with https://github.com/serenity-js/full-stack-acceptance-testing-demo. result.zip

  • I tested with version 2.4.24 from https://search.maven.org/artifact/net.serenity-bdd/serenity-cli
  • Create an empty directory and put them into subfolder ./result
  • In the root folder run java -jar serenity-cli-2.4.24.jar --source ./result --destination ./report
  • Find the report as expected within the ./report folder
  • Find an empty ./target/site/serenity as well

Shortly discussed this issue with @jan-molak here.

This issue has low impact for me at the moment, but may cause problems in environments, where you have no write access to this path for reasons.

@wakaleo wakaleo closed this as completed Feb 12, 2022
@viper3400
Copy link
Author

Hi @wakaleo , I retested this with the serenity-cli-2.6.0.jar and the serenity-cli-3.2.0.jar from https://mvnrepository.com/artifact/net.serenity-bdd/serenity-cli` and this issue is still in place. You closed this without any comment, now I wonder if you just decided to not to fix this or if you were not able to reproduce it?

@wakaleo
Copy link
Member

wakaleo commented Feb 13, 2022

Inactive issues are closed automatically from time to time.

@wakaleo wakaleo reopened this Feb 13, 2022
@wakaleo
Copy link
Member

wakaleo commented Feb 13, 2022

Happy to review a pull request for this. The line you reference is just the default value, I think.

@viper3400
Copy link
Author

Hi @wakaleo , I'm very sorry, but I was not able to build the project. Therefore I'm not able do debug or contribute, but I think I found a hint. I removed permission from the target folder on my system and got the error stack trace. It's pointing to

return Files.newDirectoryStream(outputDirectory,"browser-*.properties");

Seems there are default values set at other places, as well, not just in the cli?

PS C:\tmp\repro_cli> java -jar serenity-cli-3.2.0.jar --source ./result --destination ./report
-------------------------------
SERENITY COMMAND LINE INTERFACE
-------------------------------
Loading test outcomes from .\result
Writing aggregated report to .\report

19:00:17.376 [main] DEBUG net.thucydides.core.reports.html.HtmlAggregateStoryReporter - Generating test results for 2 tests
19:00:17.406 [main] ERROR net.serenitybdd.core.buildinfo.PropertyBasedDriverCapabilityRecord - Exception during getting driver capabilities
java.nio.file.NoSuchFileException: target\site\serenity
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
        at sun.nio.fs.WindowsDirectoryStream.<init>(WindowsDirectoryStream.java:86)
        at sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(WindowsFileSystemProvider.java:518)
        at java.nio.file.Files.newDirectoryStream(Files.java:525)
        at net.serenitybdd.core.buildinfo.PropertyBasedDriverCapabilityRecord.driverCapabilityRecords(PropertyBasedDriverCapabilityRecord.java:63)
        at net.serenitybdd.core.buildinfo.PropertyBasedDriverCapabilityRecord.getDriverCapabilities(PropertyBasedDriverCapabilityRecord.java:69)
        at net.serenitybdd.core.buildinfo.BuildInfoProvider.getBuildProperties(BuildInfoProvider.java:45)
        at net.thucydides.core.reports.html.FreemarkerContext.<init>(FreemarkerContext.java:78)
        at net.thucydides.core.reports.html.FreemarkerContext.<init>(FreemarkerContext.java:104)
        at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsIn(HtmlAggregateStoryReporter.java:153)
        at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsFrom(HtmlAggregateStoryReporter.java:135)
        at net.serenitybdd.cli.reporters.CLIAggregateReportGenerator.generateReportsFrom(CLIAggregateReportGenerator.java:66)
        at net.serenitybdd.cli.SerenityCLIReportCoordinator.execute(SerenityCLIReportCoordinator.java:56)
        at net.serenitybdd.cli.Serenity.executeWith(Serenity.java:116)
        at net.serenitybdd.cli.Serenity.main(Serenity.java:80)
19:00:17.407 [main] ERROR net.serenitybdd.core.buildinfo.PropertyBasedDriverCapabilityRecord - Exception during getting drivers
java.nio.file.NoSuchFileException: target\site\serenity
        at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:79)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
        at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
        at sun.nio.fs.WindowsDirectoryStream.<init>(WindowsDirectoryStream.java:86)
        at sun.nio.fs.WindowsFileSystemProvider.newDirectoryStream(WindowsFileSystemProvider.java:518)
        at java.nio.file.Files.newDirectoryStream(Files.java:525)
        at net.serenitybdd.core.buildinfo.PropertyBasedDriverCapabilityRecord.driverCapabilityRecords(PropertyBasedDriverCapabilityRecord.java:63)
        at net.serenitybdd.core.buildinfo.PropertyBasedDriverCapabilityRecord.getDrivers(PropertyBasedDriverCapabilityRecord.java:47)
        at net.serenitybdd.core.buildinfo.BuildInfoProvider.getBuildProperties(BuildInfoProvider.java:46)
        at net.thucydides.core.reports.html.FreemarkerContext.<init>(FreemarkerContext.java:78)
        at net.thucydides.core.reports.html.FreemarkerContext.<init>(FreemarkerContext.java:104)
        at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsIn(HtmlAggregateStoryReporter.java:153)
        at net.thucydides.core.reports.html.HtmlAggregateStoryReporter.generateReportsForTestResultsFrom(HtmlAggregateStoryReporter.java:135)
        at net.serenitybdd.cli.reporters.CLIAggregateReportGenerator.generateReportsFrom(CLIAggregateReportGenerator.java:66)
        at net.serenitybdd.cli.SerenityCLIReportCoordinator.execute(SerenityCLIReportCoordinator.java:56)
        at net.serenitybdd.cli.Serenity.executeWith(Serenity.java:116)
        at net.serenitybdd.cli.Serenity.main(Serenity.java:80)
19:00:17.419 [main] DEBUG net.thucydides.core.requirements.reports.FileSystemRequirmentsOutcomeFactory - Loaded requirements from file system = []
19:00:17.423 [main] DEBUG net.thucydides.core.reports.html.HtmlAggregateStoryReporter - 0 requirements loaded after 49 ms
19:00:17.423 [main] DEBUG net.thucydides.core.reports.html.HtmlAggregateStoryReporter - 0 related requirements found after 49 ms
19:00:17.734 [pool-3-thread-6] DEBUG net.thucydides.core.reports.html.ReportingTask - Aggregate reports generated in 271 ms
19:00:18.248 [main] DEBUG net.thucydides.core.reports.html.HtmlAggregateStoryReporter - Test outcome reports generated in 787 ms
19:00:18.248 [main] INFO net.thucydides.core.reports.html.HtmlAggregateStoryReporter - Test results for 2 tests generated in 874 ms in directory: file:/C:/tmp/repro_cli/./report/
PS C:\tmp\repro_cli>

@wakaleo
Copy link
Member

wakaleo commented Feb 20, 2022

Thanks for noticing that. At some point I will try to investigate.

@viper3400
Copy link
Author

To be clear, this is really no big issue for me, at least not for now. I would understand if you decide to not to fix and close this issue. I think we can reopen it at any time.

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

2 participants