Commit Graph

40 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
3913b28153 Only retry failed pexpect tests under CI
A false negative while testing locally should be a rare thing, and individual
pexpect tests already take too long in case of a non-match making for a painful
edit-test loop.
2022-10-25 13:40:21 -05:00
David Adam
c20a71c99f tests: require a newish Python
Specifically, Python 3.5 changed the return value type from
inspect.getouterframes().

Anything older than that is way out of date anyway.
2022-06-08 21:13:09 +08:00
Mahmoud Al-Qudsi
2962fbcf7a Add pexpect tests to new test driver 2021-08-29 08:56:12 +02:00
Fabian Homborg
2b0b0fe042 tests/bind: Skip on Github macOS
This just fails too much to be of any use.
2021-05-23 19:46:04 +02:00
Johannes Altmanninger
7a53c40fd4 Allow to run individual interactive tests by setting FISH_PEXPECT_FILES
This command builds all test dependencies and runs the bind.py test:

	FISH_PEXPECT_FILES=../tests/pexpects/bind.py ninja test_interactive
2021-01-07 17:09:05 +01:00
Fabian Homborg
5e91e5127d Remove reference to Travis
I'm still salty about that exit.
2020-11-13 15:12:14 +01:00
Fabian Homborg
fd66b66a86 tests: Retry interactive tests once
We used to have this, it helps with resource constrained CI systems
2020-11-09 19:26:27 +01:00
Fabian Homborg
52a6574751 tests: Use status dirname 2020-06-14 19:30:03 +02:00
Fabian Homborg
87a1e4f8b9 Remove expect
This should remove the last bits of expect from the codebase.
2020-06-13 19:28:42 +02:00
ridiculousfish
4ae4314e63 Improve pexpect output
Make it easier to use pexpect and to understand its error messages.
Switch to a style in tests using bound methods, which makes them
less noisy to write.
2020-06-07 14:53:17 -07:00
ridiculousfish
3b7feb38e9 Add pexpect-based interactive testing framework
This adds a new interactive test framework based on Python's pexpect. This
is intended to supplant the TCL expect-based tests.

New tests go in `tests/pexpects/`. As a proof-of-concept, the
pipeline.expect test and the (gnarly) bind.expect test are ported to the
new framework.
2020-06-07 14:46:21 -07:00
Fabian Homborg
1c880e5888 tests: Specify which tests completed successfully
It's a bit weird to just see "All tests completed successfully" and
then another set of tests follows.
2020-03-28 18:41:44 +01:00
Fabian Homborg
917f26b1dd tests/interactive.fish: Match littlecheck's coloring
Littlecheck resets the color before the time, which looks a bit nicer.

But most of all, it's inconsistent.
2020-03-28 18:40:57 +01:00
Fabian Homborg
9367d4ff71 Reindent functions to remove useless quotes
This does not include checks/function.fish because that currently
includes a "; end" in a message that indent would remove, breaking the test.
2020-03-09 19:46:43 +01:00
Aaron Gyes
9486af8805 tests: fix date --version printing junk, update interactive.fish 2019-09-19 15:06:51 -07:00
Fabian Homborg
22d2620716 Rerun all interactive tests once
They are *all* flakey enough that we regularly see them fail, at least
on Travis.
2019-06-26 21:26:20 +02:00
Fabian Homborg
ff3fe961f4 Add pipeline.expect to flakey tests
This one fails on Travis sometimes, but I've not been able to
reproduce on a real machine.
2019-05-19 20:59:03 +02:00
Mahmoud Al-Qudsi
0c5015d467 Correct the reversed diff output for all tests
This has been driving nuts for years. The output of the diff emitted
when a test fails was always reversed, because the diff tool is called
with `${difftool} ${new} ${old}` so all the `-` and `+` contexts are
reversed, and the highlights are all screwed up.

The output of a `make test` run should show what has changed from the
baseline/expected, not how the expected differs from the actual. When
considered from both the perspective of intentional changes to the test
outputs and failed test outputs, it is desirable to see how the test
output has changed from the previously expected, and not the other way
around.

(If you were used to the previous behavior, I apologize. But it was
wrong.)
2019-03-28 18:23:32 -05:00
David Adam
d8d9cfdc10 interactive tests: exit quietly if expect not available
It seems that 44cfe3e34 inadvertently included the requirement for the
expect tests to pass; revert this to its original sense.
2019-01-28 21:51:57 +08:00
Fabian Homborg
b7369213e2 tests/interactive: Scope variables correctly
This `set TERM`. Which, if $TERM is inherited, is already exported,
but not if it isn't.

This is the case on sr.ht's arch images, so we failed without a TERM variable.
2019-01-01 14:52:26 +01:00
ridiculousfish
8e2d207869 Report duration of each test 2018-09-03 14:13:31 -07:00
Peter Ammon
5b489ca30f Remove caret redirection
This removes the caret as a shorthand for redirecting stderr.

Note that stderr may be redirected to a file via 2>/some/path...
and may be redirected with a pipe via 2>|.

Fixes #4394
2018-04-01 13:48:21 -07:00
Fabian Homborg
aa31fb92f2 Skip interactive tests on macOS on Travis
These just add noise since Travis' macOS machines are apparently
hopelessly overloaded.

Fixes my sanity.
2018-02-06 18:54:27 +01:00
Kurtis Rader
44cfe3e340 remove dependency on xxd
Fixes #3797
2017-01-31 22:10:53 -08:00
Kurtis Rader
06282f02fd don't run fish_update_completions in unit tests
Running `fish_update_completions` in unit tests is not needed and
hideously expensive. To the point it can cause flakey test behavior.
2017-01-29 18:00:48 -08:00
Kurtis Rader
93bea5b321 make unit tests more hermetic regarding env vars
Specifically, the `TERM` and `ITERM_PROFILE` env vars. If we don't set
them to known values the unit tests can fail in unexpected ways.

Fixes #3395
2016-09-19 22:13:55 -07:00
Kurtis Rader
2f0cb2a32b remove the tests/*.status files
The tests/*.status files aren't useful so eliminate them. Just verify whether
a given test module exited with a success status. There isn't any point in
having a "status" file that indicates the test module should exit with a
success (zero) status.

Closes #3208
Closes #3209
2016-07-06 21:37:29 -07:00
Kurtis Rader
0993141334 retry flakey tests on failure
Fixes #2926
2016-04-11 16:47:46 -07:00
Kurtis Rader
8b67a1b26f make testing on local servers hermetic
I noticed while fixing issue #2702 that the fish program being tested
was sourcing config.fish files outside of the current build. This also
happens when Travis CI runs the tests but isn't an issue there because
of how Travis is configured to execute the tests.

I also noticed that running `make test` was polluting my personal fish
history; which will become a bigger problem if and when the fishd universal
var file is moved from $XDG_CONFIG_HOME to $XDG_DATA_HOME.

This change makes it possible for an individual to run the tests on
their local machine secure in the knowledge that only the config.fish and
related files from their git repository will be used and doing so won't
pollute their personal fish history.

Resolves #469
2016-02-25 17:16:36 -08:00
Kurtis Rader
6969cfab3d fix unit tests related to the escape timeout 2015-12-23 21:41:48 -08:00
David Adam
55abe105ea tests/bind.expect: re-enable but at human typing speed only
The interactive bind tests work if the keys are treated like there is a
human pressing them.

This reverts commit 0006d23df8.
2015-10-18 21:12:12 +08:00
Fabian Homborg
0006d23df8 Disable the bind test for now
This isn't pretty, but it fails for, as far as I can see, no _real_
reason.

It doesn't seem to be possible to trigger the failure in real usage, no
matter how fast you press the ESC key followed by something else.

So now this is known and constant travis emails don't help it in any way.
2015-10-18 14:14:22 +02:00
Kevin Ballard
e13d423b68 Tweak test runner to set up environment better
Update the test runners so they set up their own environment in
test_util.fish. This simplifies the Makefile and paves the way for
adding utility functions for use in the tests themselves.
2014-11-24 01:51:07 -08:00
Kevin Ballard
ae7b6156ac Rewrite fishscript testrunner for better output
Update the fishscript testrunner to use the same output style as the
interactive testrunner.
2014-10-02 12:33:42 -07:00
Kevin Ballard
1563501868 Fix missing "1 test failed" line
Also tweak colored output to reset before the newline instead of after,
so travis behaves better (for some reason reset causes travis to display
the line in black).
2014-09-23 22:50:28 -07:00
Kevin Ballard
5f82f721d2 Rejigger test suite
Split test_interactive off from test_fishscript and add a new target
test_high_level that tests both.

Add some Makefile magic so the tests can be run serially without using
sub-make, which gets rid of a little noise from the make output.

Rewrite interactive tests to look better.
2014-09-23 22:39:23 -07:00
Kevin Ballard
51c2005ea2 Tweak interactive debug output 2014-09-19 16:22:37 -07:00
Kevin Ballard
510ff6a689 Dump interactive logs on travis test failure
As far as I know we can't access the build artifacts from Travis, so we
can't check the interactive logs after a test failure. Add an
environment variable that causes the test runner to dump the logs
itself, and set that variable for Travis.
2014-09-19 14:52:02 -07:00
Kevin Ballard
0a32d96b27 Reset fish_bind_mode when changing fish_key_bindings
Also avoid resetting bindings if fish_key_bindings is "modified" without
actually changing.

Fixes #1638.
2014-09-18 15:46:17 -07:00
Kevin Ballard
190712d4b0 Add a test harness for interactive behavior
Add a test harness that uses `expect` to drive Fish to test interactive
behavior.

Include some tests for `read`.
2014-09-07 23:56:59 -07:00