rokucommunity / rooibos

simple, flexible, fun brightscript test framework for roku scenegraph apps
MIT License
74 stars 29 forks source link

Incompatibilities with brighterscript 0.53+ #185

Closed ZeeD closed 1 year ago

ZeeD commented 2 years ago

(I've found this starting using the rooibos-roku-demo, and the after an update of bs)

it seems that using brighterscript 0.53+ there are some errors with the plugin:


node_modules/rooibos-roku/dist/lib/framework/BaseTestSuite.bs:41:47 - error BS1001: Cannot find name 'Rooibos_Matcher_anyString'

 41      protected anyStringMatcher = { "matcher": Rooibos_Matcher_anyString }
 __                                                ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/rooibos-roku/dist/lib/framework/BaseTestSuite.bs:42:45 - error BS1001: Cannot find name 'Rooibos_Matcher_anyBool'

 42      protected anyBoolMatcher = { "matcher": Rooibos_Matcher_anyBool }
 __                                              ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/rooibos-roku/dist/lib/framework/BaseTestSuite.bs:43:47 - error BS1001: Cannot find name 'Rooibos_Matcher_anyNumber'

 43      protected anyNumberMatcher = { "matcher": Rooibos_Matcher_anyNumber }
 __                                                ~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/rooibos-roku/dist/lib/framework/BaseTestSuite.bs:44:43 - error BS1001: Cannot find name 'Rooibos_Matcher_anyAA'

 44      protected anyAAMatcher = { "matcher": Rooibos_Matcher_anyAA }
 __                                            ~~~~~~~~~~~~~~~~~~~~~

node_modules/rooibos-roku/dist/lib/framework/BaseTestSuite.bs:45:46 - error BS1001: Cannot find name 'Rooibos_Matcher_anyArray'

 45      protected anyArrayMatcher = { "matcher": Rooibos_Matcher_anyArray }
 __                                               ~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/rooibos-roku/dist/lib/framework/BaseTestSuite.bs:46:45 - error BS1001: Cannot find name 'Rooibos_Matcher_anyNode'

 46      protected anyNodeMatcher = { "matcher": Rooibos_Matcher_anyNode }
 __                                              ~~~~~~~~~~~~~~~~~~~~~~~
ZeeD commented 2 years ago

As a temporary fix I changed the lines in https://github.com/georgejecook/rooibos/blob/a3e4c42482e50c8c480f34f3df0534ccb50ee674/framework/src/source/BaseTestSuite.bs#L41-L46 (in my node_modules folder) replacing Rooibos_Matcher_XXX with rooibos.Matcher.XXX

georgejecook commented 1 year ago

I've got a branch open for this and will push a release sometime this week.

georgejecook commented 1 year ago

please try again with rooibos 5.3.0, and let me know if it works

ZeeD commented 1 year ago

Hi @georgejecook ! thanks for the update. I find that now most of the problems have gone away. Thanks! Still, I have some troubles:

it seems to me there are some incompatibilities between the "style" of the tests and the compiler, specifically regarding the sub / function differences between the return.

My old tests where sub; after the update I managed to use bslint and it suggested to replace them with functions (as I saw in other projects), but I'm not sure what is the appropriate value to return. for the moment I just put return invalid but please tell me if I should use another value.

ZeeD commented 1 year ago

another thing: I'm not sure if it is rooibos or bsc, but for some reason while I create the .zip file to deploy, I see that https://github.com/georgejecook/rooibos/blob/fdbc7bad2e1f5bd9f2bf615785ac049439e83c55/framework/src/source/ConsoleTestReporter.bs#L4-L14 is translated to

function __rooibos_ConsoleTestReporter_builder()
    instance = __rooibos_BaseTestReporter_builder()
    instance.super0_new = instance.new
    instance.new = function(testRunner)
        m.super0_new()
        m.lineWidth = 60

        m.super0_new(testRunner)
        if m.config.lineWidth <> invalid
            m.lineWidth = m.config.lineWidth
        else
            m.lineWidth = 60
        end if
    end function

that blows up because m.super0_new is called twice, the first time with the wrong number of parameters.

freemanchari commented 1 year ago

@ZeeD did you ever find a solution to this?

georgejecook commented 1 year ago

you need to use latest bsc and rooibos-bsc plugin.

freemanchari commented 1 year ago

Thanks @georgejecook that worked. Maybe this part of the docs needs to be updated Rooibos currently requires brighterscript version 0.52.3 - please use only this version

georgejecook commented 1 year ago

Good catch! will get it updated! thank you.

On Mon, Feb 6, 2023 at 8:37 PM Freeman @.***> wrote:

Thanks @georgejecook https://github.com/georgejecook that worked. Maybe this part of the docs needs to be updated Rooibos currently requires brighterscript version 0.52.3 - please use only this version

— Reply to this email directly, view it on GitHub https://github.com/georgejecook/rooibos/issues/185#issuecomment-1419641502, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJIQUP47VJZCPVN4GQFPZ3WWFHH7ANCNFSM57LQTFZQ . You are receiving this because you were mentioned.Message ID: @.***>

-- George Cook ------------------- Roku Shaman @ Tantawowa LLC

https://tantawowa.com/ https://tantawowa.com/

maestro-roku framework: https://github.com/georgejecook/maestro-roku rooibos testing framework: https://github.com/georgejecook/rooibos roku-log: htps://github.com/georgejecook/roku-log https://github.com/georgejecook/roku-log

"ALL RIGHT.. TIMES UP.. LETS DO THIS!!"

ZeeD commented 1 year ago

In any case I think I can close this ticket, then