Skip to content
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

Output stdout from long running task #5

Merged
merged 5 commits into from
Sep 2, 2024

Conversation

citizen-stig
Copy link
Member

@citizen-stig citizen-stig commented Sep 2, 2024

Tested with following markdown:

This is how bashtestmd works.

You can start with long-running command

```sh,test-ci,bashtestmd:long-running,bashtestmd:wait-until=PING
$ ping 8.8.8.8

And then do couple other commands.

This will just check exit code

$ date

This will compare output

$ echo "Hello world"
Hello world

and if output does not match, it will fail, and also prints output of the long running command

$ whoami
super-root```

and output is:

Running: 'ping 8.8.8.8'
Waiting for process with PID: 33937 to have a match in /var/folders/cq/zfvc0h8s1199jjhrk2spc1mw0000gn/T/tmp.G4NeQNbryJ
.
Running: 'date'
Mon Sep  2 09:59:57 CEST 2024
Running: 'echo "Hello world"'
Running: 'whoami'
'super-root```
' not found in text:
'nikolai'
Output of the long running task:
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: icmp_seq=0 ttl=116 time=21.474 ms
64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=15.565 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=22.328 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=116 time=51.119 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=116 time=19.185 ms
=========== END OF THE LONG RUNNING OUTPUT. Terminating...
demo-bash.sh: line 67: 33937 Terminated: 15          ping 8.8.8.8 >&$long_running_output

@citizen-stig citizen-stig marked this pull request as ready for review September 2, 2024 08:04
@neysofu
Copy link
Member

neysofu commented Sep 2, 2024

We should also bump the patch version number.

@citizen-stig citizen-stig merged commit e464e91 into main Sep 2, 2024
3 checks passed
@neysofu neysofu deleted the nikolai/output-long-running-logs branch September 2, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants