What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hello. I have to set shared config value in acceptance tests for Glue. Added the config helper. But

UQS4LDZU7
UQS4LDZU7 Posts: 182 πŸ§‘πŸ»β€πŸš€ - Cadet
edited November 2019 in Help

Hello. I have to set shared config value in acceptance tests for Glue. Added the config helper. But $i->setConfig('bla', false) doesn't work. Someone knows a workaround maybe?

Comments

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    Acceptance tests are basically browser clicking

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    you can't set config (or access DB etc.) when doing acceptance tests

  • UQS4LDZU7
    UQS4LDZU7 Posts: 182 πŸ§‘πŸ»β€πŸš€ - Cadet

    Well, the thing is, the check of config variable happens in the glue layer. So, there is no way to write Glue tests for true/false scenarios, thats sad.

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    you can write the test, just not the acceptance test where you will modify the config before running the test like you can with functional or unit tests

  • UQS4LDZU7
    UQS4LDZU7 Posts: 182 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited November 2019

    Thought that as well. Didnt find any "inspiration" in vendor for that. All Glue tests seem to be acceptance ones

  • UKHD8KTMF
    UKHD8KTMF Posts: 393 πŸ§‘πŸ»β€πŸš€ - Cadet

    Question is do you want to test if glue works or if the logic that glue layer is calling works

  • UQS4LDZU7
    UQS4LDZU7 Posts: 182 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited November 2019

    I have to test that if a config var is false, the actions in related Glue bundle dont proceed with resource creation, but just give a response "resource not enabled". As I said, this all happens in Glue, before any client---zed calls take place, as they shouldnt. So, to your question - its first variant.

  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    if a config var is false, the actions in related Glue bundle dont proceed with resource creation, but just give a response β€œresource not enabled”.

    This still sounds to me like mixing functional and acceptance tests

    • Set/mock config to true/false and check the response code (403) or client response (whatever) - sounds like functional test
    • Execute external commands against glue and validate json - is acceptance tests. In this case, all your environment (including config you mention) must be already in place and running. So no way to change it in acceptance test.
  • Andriy Netseplyayev
    Andriy Netseplyayev Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited November 2019

    To understand the acceptance test, imagine you’re sitting in front of the browser w/o any access to the code. You can click around and verify results (message appear, image visible, et).

  • UQS4LDZU7
    UQS4LDZU7 Posts: 182 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited November 2019

    @UKJSE6T47 Thank you, I know, that ACs are for "click on the browser" and its with functional tests to proceed here. I just ask myself, why there are no func tests for Glue in vendor. Because the actual case I have is just about it, actually. I need to set the config value inside a test and then call a glue action. And all logic I want to test resides inside Glue as well.