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

json export is failing if the directory log_parser_output/exports is not existing #188

Closed
mickaelgobbo opened this issue Oct 4, 2024 · 1 comment · Fixed by #190
Closed

Comments

@mickaelgobbo
Copy link
Collaborator

Expected Behaviour

By calling the methods exportLogDataToJSON, if the log_parser_output/exports directory is not existing, we expect to have this one created by the log-parser.

It's the case for HTML and csv export, and it's working.

Actual Behaviour

Currently, if the job calling the lob parser didn't create explicitly the directory log_parser_output/exports, it's failing.

The log parser directory for extraction (log_parser_output/exports) is defined here:

public static final String LOG_PARSER_EXPORTS = "log_parser_output/exports";

In the case of Json export, if the directory is not explicity created before, it's failing with the issue:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.4.1:java (default-cli) 
on project parseCampaignLogs: An exception occurred while executing the Java class. 
Encountered error while exporting the log data to a JSON file.: 
log_parser_output/exports/logsExtraction.json (No such file or directory) -> [Help 1]

The stack trace is:

com.adobe.campaign.tests.logparser.exceptions.LogDataExportToFileException: Encountered error while exporting the log data to a JSON file.
    at com.adobe.campaign.tests.logparser.core.LogData.exportLogDataToJSON (LogData.java:548)
    at com.adobe.campaign.tests.logparser.core.LogData.exportLogDataToJSON (LogData.java:521)
    at com.adobe.campaign.tests.logs.ExtractACCLogs.main (ExtractACCLogs.java:74)
    at org.codehaus.mojo.exec.ExecJavaMojo.doMain (ExecJavaMojo.java:358)
    at org.codehaus.mojo.exec.ExecJavaMojo.doExec (ExecJavaMojo.java:347)
    at org.codehaus.mojo.exec.ExecJavaMojo.lambda$execute$0 (ExecJavaMojo.java:269)
    at java.lang.Thread.run (Thread.java:834)
Caused by: java.io.FileNotFoundException: log_parser_output/exports/logsExtraction.json (No such file or directory)
@baubakg
Copy link
Member

baubakg commented Oct 4, 2024

Problem reproduced for CSV as well.

@baubakg baubakg linked a pull request Oct 4, 2024 that will close this issue
10 tasks
baubakg added a commit that referenced this issue Oct 4, 2024
…ing (#190)

* Solved issue #188 making sure tests delete the directory before starting
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 a pull request may close this issue.

2 participants