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

process multiple output.xml #63

Closed
fspegni opened this issue Mar 22, 2019 · 4 comments
Closed

process multiple output.xml #63

fspegni opened this issue Mar 22, 2019 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Milestone

Comments

@fspegni
Copy link
Contributor

fspegni commented Mar 22, 2019

Would it be possible to take as input multiple output.xml files? Similarly to what rebot does. At the moment the only thing I was able to do was to merge the several output.xml into a single file (with a single <robot ...> element) and pass it to robotmetrics. The nasty part is removing the multiple copies of the <robot ...> element (one per output.xml file), then merge the children elements, then wrap all the children with a single outer <robot ...> element. It would be nice if the tool could take care of that.

@adiralashiva8 adiralashiva8 added enhancement New feature or request question Further information is requested help wanted Extra attention is needed labels Mar 22, 2019
@adiralashiva8
Copy link
Owner

adiralashiva8 commented Mar 24, 2019

Workaround for this scenario could be creating .bat or .sh file and executing .bat or .sh file (to perfrom multiple actions)

robot test.robot &&
rebot --output output.xml --merge output1.xml output2.xml output3.xml &&
robotmetrics [:options]

robotframework-metrics will be created by parsing output,xml (which is created by merging multiple xmls)

@fspegni
Copy link
Contributor Author

fspegni commented Mar 25, 2019

Digging a bit the robotframework API, I found out it already has support for processing multiple output.xml files. So I patched the robotmetrics.py file this way:

    # output.xml file
    output_names = [ os.path.join(path, curr) for curr in opts.output.split(",") ]

    # report.html file
    report_name = opts.report_name

    # log.html file
    log_name = opts.log_name

##    required_files = (
##        output_name,
##        # report_name,
##        # log_name,
##    )
    required_files = output_names
...
    # Read output.xml file
    result = ExecutionResult(*output_names)

I assume the parameter output can accept a list of filenames divided by ,, so I split and append all the names ot the working directory. It seems it works. I test it a little bit more and make a pull request for this, if you agree.

@adiralashiva8
Copy link
Owner

Amazing, I will look into this, thanks for inputs and your contribution

@adiralashiva8
Copy link
Owner

Fixed as part of #65 pull request

@adiralashiva8 adiralashiva8 added this to the v-3-1-2 milestone May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants