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

automated integration tests #4

Open
slingamn opened this issue Mar 9, 2023 · 5 comments
Open

automated integration tests #4

slingamn opened this issue Mar 9, 2023 · 5 comments
Labels
testing Tests or test framework enhancements

Comments

@slingamn
Copy link
Member

slingamn commented Mar 9, 2023

Investigate https://github.com/charmbracelet/vhs for this: https://www.youtube.com/watch?v=dtVezRX8OEM

@slingamn slingamn added the testing Tests or test framework enhancements label Mar 10, 2023
@wader
Copy link
Collaborator

wader commented Mar 10, 2023

Played around a bit, very impressive, have heard about before but didn't really understand what it was about. I'm using some expect for some basic fq CLI/REPL tests but it is a mess and very shakey.

@tpodowd
Copy link
Collaborator

tpodowd commented Mar 13, 2023

Yeah. I am using expect also for testing. This looks promising.

@wader
Copy link
Collaborator

wader commented Mar 13, 2023

I tried vhs a bit for testing fq but i'm having trouble making the "golden" output stable, maybe i'm doing something wrong.

@tpodowd Having any success using expect to test readline completion? having trouble with that too :)

Example tape that i tried that changes a bit with every run:

Output test.ascii

Type "fq -i . doc/file.mp3"
Enter
Sleep 0.2s
Type "repeat(empty)"
Enter
Sleep 0.5s
Enter
Ctrl+C
Sleep 0.5s
Type ".h"
Tab
Sleep 0.5s
Enter
Sleep 0.5s
Type ".frames[0] | repl"
Enter
Type ".audi"
Tab
Sleep 0.5s
Enter
Sleep 0.5s
Ctrl+D
Sleep 0.5s
Ctrl+D
Sleep 0.5s
Ctrl+D

@tpodowd
Copy link
Collaborator

tpodowd commented Mar 14, 2023

Hi @wader - I'm going to be no help and say that for completion testing, I'm not actually testing the terminal output but instead I'm constructing tests around the AutoCompleter interface Do() function which I implement and ensuring my behaviour is right at that level as that is where my complexity is.

@wader
Copy link
Collaborator

wader commented Mar 14, 2023

@tpodowd I see, no worries 👍 Yeah i do something similar but turned out the test script version of the readline works a tiny bit different so didn't catch a regression. Can post here if i figure how to do it, maybe useful for someone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Tests or test framework enhancements
Projects
None yet
Development

No branches or pull requests

3 participants