Skip to content

Detect spurious slash at end of ReportPortal URL #194

@lmazureNX

Description

@lmazureNX

Is your feature request related to a problem? Please describe.
My configuration

  • ReportPortal 5.7.2 in Docker in WSL2 on my laptop
  • I am running some simple tests Robot Framework tests (https://gitlab.com/m4711/robotframework-samples)
  • I try to push their results in ReportPortal (using gitbash in Windows on my laptop)

I tried initially with the following command line;

robot --outputdir reports --listener robotframework_reportportal.listener --variable RP_UUID:"b58f8cf0-56a1-44eb-a1ca-45453d5302bc" --variable RP_ENDPOINT:"http://127.0.0.1:8080/" --variable RP_LAUNCH:"my ROBOTFRAMEWORKSAMPLES launch" --variable RP_PROJECT:"ROBOTFRAMEWORKSAMPLES" --xunit junit_report.xml --variable RP_ATTACH_XUNIT:"True" --variable RP_ATTACH_REPORT:"True" --variable RP_ATTACH_LOG:"True" mazure.robot

I got:

$ robot --outputdir reports --listener robotframework_reportportal.listener --variable RP_UUID:"b58f8cf0-56a1-44eb-a1ca-45453d5302bc" --variable RP_ENDPOINT:"http://127.0.0.1:8080/" --variable RP_LAUNCH:"my ROBOTFRAMEWORKSAMPLES launch" --variable RP_PROJECT:"ROBOTFRAMEWORKSAMPLES" --xunit junit_report.xml --variable RP_ATTACH_XUNIT:"true" --variable RP_ATTACH_REPORT:"true" --variable RP_ATTACH_LOG:"true" mazure.robot
==============================================================================
Mazure :: An example to discover Robot Framework
==============================================================================
Redirection                                                           | PASS |
------------------------------------------------------------------------------
Access to site map                                                    | PASS |
------------------------------------------------------------------------------
Open and close site map nodes                                         | PASS |
------------------------------------------------------------------------------
Mazure :: An example to discover Robot Framework                      | PASS |
3 tests, 3 passed, 0 failed
==============================================================================
Output:  C:\Users\lmazure\Documents\code\tempo\robotframework-samples\reports\output.xml
XUnit:   C:\Users\lmazure\Documents\code\tempo\robotframework-samples\reports\junit_report.xml
Log:     C:\Users\lmazure\Documents\code\tempo\robotframework-samples\reports\log.html
Report:  C:\Users\lmazure\Documents\code\tempo\robotframework-samples\reports\report.html
Invalid response: Expecting value: line 1 column 1 (char 0): <!doctype html>
  <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta charset="utf-8">
      <title>Report Portal</title>
      <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <link rel="shortcut icon" href="favicon.ico" integrity="sha256-Mr4AWVWgTArdmfjZN1U+2tmaoaN8yDYA3/qI6356in8= sha384-QcqS5R2LgskCl7kI5omfbGh5EfXB0V9SPHt4iyhgQJT2A7YBrhh26RT1hiL9Ji7H" crossorigin="anonymous"><link href="styles.4cddaa.css" rel="stylesheet" integrity="sha256-QOuA3f687xImz6IhHhV1/4Q00gomP94tOVF/gD5eJ2k= sha384-vpHCo6OBGrJ3Wx553KODN2v6hrQFCMOXx7jFT3ANRCGY2tiTRtq2zoERgvBs9t2t" crossorigin="anonymous"><link href="main.4cddaa.css" rel="stylesheet" integrity="sha256-T9iuSHMgycfoYAns8tS160x/YNDBE+zdEQ3jX5NVqlU= sha384-9ryc8ya6F0/wdwD5uOlZ0/r/xh0DrE8Y+LB8N0jKkiKt00issn2er8ondLqkV07W" crossorigin="anonymous"></head>
    <body>
      <div id="app" style="width: 100%; height: 100%;"></div>
      <div id="popover-root"></div>
      <div id="modal-root"></div>
      <div id="tooltip-root"></div>
      <div id="notification-root"></div>
      <div id="screen-lock-root"></div>
    <script type="text/javascript" src="polyfills.app.4cddaa.js" integrity="sha256-1ZGc8CL195nAHjxzHp1O3nlwQ/MJugkpsnHDGfxwxz8= sha384-P6ra7XZ+Lp6c9WiEFw4iLDwIxwE9B1mo8lnn8eGMcjmKQ1US6dNFZHzmbveTRzfd" crossorigin="anonymous"></script><script type="text/javascript" src="styles.app.4cddaa.js" integrity="sha256-+lh4MEnjvnB1JzBHdRBt/6Su+cjbu2TMg4UZ8qos0Pw= sha384-9pFLuwI8xfYv2fBMN1fDMjOllhCYZwarv8CmE9SvkmV5MVuSSXrt6NWj7G7BInpV" crossorigin="anonymous"></script><script type="text/javascript" src="main.app.4cddaa.js" integrity="sha256-GHReOkFpGqOMJmpHoy4Jc6N7eF9qjVRhaSAZYoAq/54= sha384-F13Po5ujXxWAYhF6zQJz1TUroRD021Sj98x782IURdgdDoc491qr9+x8t8TeLCYT" crossorigin="anonymous"></script></body>
  </html>
Traceback (most recent call last):
  File "C:\Users\lmazure\AppData\Local\Programs\Python\Python39\lib\site-packages\reportportal_client\core\rp_responses.py", line 77, in _get_json
    return data.json()
  File "C:\Users\lmazure\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 910, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\lmazure\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\lmazure\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\lmazure\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

After some time, I got the idea to remove the slash at the end of the ReportPortal URL, things went better:

$ robot --outputdir reports --listener robotframework_reportportal.listener --variable RP_UUID:"b58f8cf0-56a1-44eb-a1ca-45453d5302bc" --variable RP_ENDPOINT:"http://127.0.0.1:8080" --variable RP_LAUNCH:"my ROBOTFRAMEWORKSAMPLES launch" --variable RP_PROJECT:"ROBOTFRAMEWORKSAMPLES" --xunit junit_report.xml --variable RP_ATTACH_XUNIT:"True" --variable RP_ATTACH_REPORT:"True" --variable RP_ATTACH_LOG:"True" mazure.robotNDPOINT:"http://127.0.0.1:8080" --variable RP_LAUNCH:"my ROBOTFRAMEWORKSAMPLES launch" --variable RP_PROJECT:"ROBOTFRAMEWO==============================================================================le RP_ATTACH_REPORT:"true" --variable RP_ATTACH_LOG:"true" mazure.robot
Mazure :: An example to discover Robot Framework
==============================================================================
Redirection                                                           | PASS |
------------------------------------------------------------------------------
Access to site map                                                    | PASS |
------------------------------------------------------------------------------
Open and close site map nodes                                         | PASS |
------------------------------------------------------------------------------
Mazure :: An example to discover Robot Framework                      | PASS |
3 tests, 3 passed, 0 failed
==============================================================================
Output:  C:\Users\lmazure\Documents\code\tempo\robotframework-samples\reports\output.xml
XUnit:   C:\Users\lmazure\Documents\code\tempo\robotframework-samples\reports\junit_report.xml
Log:     C:\Users\lmazure\Documents\code\tempo\robotframework-samples\reports\log.html
Report:  C:\Users\lmazure\Documents\code\tempo\robotframework-samples\reports\report.html

Describe the solution you'd like
Would it be possible to get a real error message when the URL is incorrect?

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions