GithubHelp home page GithubHelp logo

Variable support about testcl HOT 5 CLOSED

landro avatar landro commented on August 22, 2024
Variable support

from testcl.

Comments (5)

landro avatar landro commented on August 22, 2024

Glad you like TesTcl, @snorrebrandstadmoen. Have you tried defining this as a global variable?

from testcl.

snorrebrandstadmoen avatar snorrebrandstadmoen commented on August 22, 2024

@landro - I guess the log_level variable could be global, but this was just an example. Typically I want to log ie. session based information like HTTP:uri or HTTP:host in the HTTP_RESPONSE event, and these are unavailable in the "response context" and must therefore be set as an variable in the incoming HTTP_REQUEST event.

from testcl.

landro avatar landro commented on August 22, 2024

F5 has redefined the behavior of the set command - right now TesTcl uses a standard set implementation, where variables go out of scope as you would expect in any programming language. They should have used/defined some kind of exchange/context similar to what you find in SOAP/REST frameworks. Well - whatever - right now you're left with two options:

  1. Use global variables (which could work - you might have to define tests in separate files maybe to avoid collisions)
  2. Make a code contribution. One could use upvar/uplevel, look at the callstack, and redefine set if called inside when command (otherwise, stuff might stop working elsewhere, since set is a standard command).

I noticed by the way #34 is a similar open issue

from testcl.

landro avatar landro commented on August 22, 2024

closed in a5c289d

from testcl.

snorrebrandstadmoen avatar snorrebrandstadmoen commented on August 22, 2024

Thanks!

from testcl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.