robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
182 stars 15 forks source link

[BUG] Debugger ListenerV3 end_suite object has no attribute 'lineno' in RF 4.1 #157

Closed Orca75 closed 1 year ago

Orca75 commented 1 year ago

Hi,

I have a small test robot with the Suite Teardown in it. When I execute it with robotcode, I get this errror. Is there a method to avoid that? I changed the code to use the Suite Setup and Suite Teardown to have a hierarchical layer of tests with setup and prepare devices before testing things.

Project.Projects.NSO-Titan.Services.Suite-Test.Sub.sub-T1                     
==============================================================================
Sub-Test1 Setup
Sub-TC1                                                               Sub-T1:TC1
Sub-TC1                                                               | PASS |
------------------------------------------------------------------------------
Sub-TC2                                                               Sub-T1:TC2
Sub-TC2                                                               | PASS |
------------------------------------------------------------------------------
Sub-Test1 Teardown
[ ERROR ] Calling method 'end_suite' of listener 'robotcode.debugger.listeners.ListenerV3' failed: AttributeError: 'TestCase' object has no attribute 'lineno'
Project.Projects.NSO-Titan.Services.Suite-Test.Sub.sub-T1             | PASS |
2 tests, 2 passed, 0 failed
==============================================================================```

Here the sub-T1.robot:

*** Variables ***
${save_dir}                   ${CURDIR}

*** Settings ***
Resource           ../../Services_keywords.robot
Suite Setup        Test Setup
Suite Teardown     Test Teardown

*** Test Cases ***
Sub-TC1
    Log to console    Sub-T1:TC1
    #FAIL
Sub-TC2
    Log to console    Sub-T1:TC2

*** Keywords ***
Test Setup
    Log to console    Sub-Test1 Setup
Test Teardown
    Log to console    Sub-Test1 Teardown

If I do it with the [Teardown] I have no problems (since it doesn't use the Suite Teardown.

==============================================================================
Sub-Test1 Setup
Sub-TC1                                                               Sub-T1:TC1
Sub-TC1                                                               | PASS |
------------------------------------------------------------------------------
Sub-TC2                                                               Sub-T1:TC2
.Sub-Test1 Teardown
Sub-TC2                                                               | PASS |
------------------------------------------------------------------------------
Project.Projects.NSO-Titan.Services.Suite-Test.Sub.sub-T11            | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
*** Variables ***
${save_dir}                   ${CURDIR}

*** Settings ***
Resource           ../../Services_keywords.robot
Suite Setup        Test Setup

*** Test Cases ***
Sub-TC1
    Log to console    Sub-T1:TC1
    #FAIL
Sub-TC2
    Log to console    Sub-T1:TC2
    [Teardown]    Test Teardown

*** Keywords ***
Test Setup
    Log to console    Sub-Test1 Setup
Test Teardown
    Log to console    Sub-Test1 Teardown

Desktop (please complete the following information):

It would be nice, if you have a hint or solution for that. Thanks Chris

d-biehl commented 1 year ago

Oh, ups, there is a bug in the support for Robot Framework 4.1. I can fix it, but don't know exactly when yet. Probably not until next week.

However, you are using a very old Robot Framework version, why? The current version is 6.1. With the newer RobotFramework, starting with version 5, this bug should not occur. Did you try a newer version of Robot Framework?

Orca75 commented 1 year ago

Ah, no hurry. We use a docker from cisco with cxta that builds on robot. We are on it to update to a later version what has a newer version of robot. So I will see that we can proceed with that. Thanks for the clarifying.

d-biehl commented 1 year ago

was easier to fix than I thought at first.

Orca75 commented 1 year ago

Wow, that was really fast. Thanks a lot. It's now working fine.

Liebe Grüsse aus der Schweiz nach Deutschland!