-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion #7
Comments
The optimal solution would be to make the system under test easier to test. With the current loop construct in lux you can do like this: +expected-output Then the lux script would be successful if the expected output is matched, /Håkan On Fri, Nov 27, 2015 at 10:16 AM, Claes Wikstrom [email protected]
|
On 27/11/15 11:00, Håkan Mattsson wrote:
All asynchronous systems have this characteristic, it's inherent in
Or,
That requires adding code to the system, a lot of code.
+1
Disagree, see my UDP example above.
I'll be damned !!! re-reading the lux UG, this is exactly what I was Quote UG + In the active shell, the /klacke |
Hmmm, re-reading once more, and this is close bu no cigarr, when the +expr matches, it seems we directly to cleanup, thus this construct can only be used once in a script, I'd like to use it many time over and over again in the same script. !request do something !request do something else .... |
[macro async-matcher action pattern] |
Hakan, how hard would this be?
When writing reactive fastmap applications a common scenario for lux tests
is as follows (This applies to any async application, where the results of the
command may take some time to produce)
Using CLI:
!set x y
?[\ok]
set a b
?[ok]
!commit
?[ok]
The crux is that in RFM apps, the result isn't there after commit, it takes some
time to produce. I've now started to craft various custom script for this pattern,
!my-wait-scrip.sh foo bar baz
?WAIT_SCRIPT_OK
Where the script, in a loop, issues a command and expects some data.
Lux could support this, e.g think:
[try-loop 1 20]
!show status my-fastmap foo
?expected-output
[end try-loop]
Which then tries 20 times, with one sec between the attempts. On first success of all commands in the block we're good to go and can continue. I understand that this is exactly semantically the same as
[sleep 20]
!show status my-fastmap foo
?expected-output
Sleeps are really bad though.
Opinions ?
/klacke
The text was updated successfully, but these errors were encountered: