Skip to content

Revert "Fix move to line start in multi-line history entries"#704

Merged
fdncred merged 1 commit into
mainfrom
revert-584-582-move-to-line-start
Jan 11, 2024
Merged

Revert "Fix move to line start in multi-line history entries"#704
fdncred merged 1 commit into
mainfrom
revert-584-582-move-to-line-start

Conversation

@fdncred

@fdncred fdncred commented Jan 11, 2024

Copy link
Copy Markdown
Contributor

Reverts #584

This is causing odd test behavior like ansi escapes, seeing reedline prompts in the middle of testing, leaving the terminal in a raw state.

@boathouse2112 If you can find a fix for this it would be great!!

These are the two test commands that I run and see the problems.

cargo test --features=bashisms,sqlite,external_printer,system_clipboard

and

cargo nextest run --all-features

@codecov

codecov Bot commented Jan 11, 2024

Copy link
Copy Markdown

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (0c5f981) 56.09% compared to head (b619ebb) 49.32%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #704      +/-   ##
==========================================
- Coverage   56.09%   49.32%   -6.78%     
==========================================
  Files          46       46              
  Lines        7993     7998       +5     
==========================================
- Hits         4484     3945     -539     
- Misses       3509     4053     +544     
Files Coverage Δ
src/engine.rs 4.97% <36.36%> (-17.39%) ⬇️

... and 14 files with indirect coverage changes

@fdncred fdncred merged commit ef7b96c into main Jan 11, 2024
@fdncred fdncred deleted the revert-584-582-move-to-line-start branch January 11, 2024 21:41
@stormasm

Copy link
Copy Markdown
Contributor

We need to be able to run these tests on all (3) of our platforms including Windows and Mac...

Currently the CI is not set up to do this...

I would be willing to run the tests on my Mac once they are fixed and I am sure someone would be willing to run them on Windows as well prior to re-landing these tests...

Thanks !

@stormasm

stormasm commented Jan 11, 2024

Copy link
Copy Markdown
Contributor

I don't think these tests belong in Engine.

We want to keep the Engine code clean and just keep this one test in there that has been there for awhile.

#[test]
fn thread_safe() {
    fn f<S: Send>(_: S) {}
    f(Reedline::create());
}

I think we should start a test directory under the top level Reedline and put them there...

The following comments were observed on a Mac.

There appears to be some strange race conditions which are caused by running the tests in parallel
with nextest...

They pass some of the time in the cargo test runner (with no issue) but have more serious issues in nextest which is not a good sign.

@stormasm

stormasm commented Jan 11, 2024

Copy link
Copy Markdown
Contributor

I am going to experiment with refactoring the tests and getting rid of the rstest functionality. This may be blocking nextest which is what I am seeing...

I think by refactoring the tests to have individual tests with just the different type of input scenarios would be simpler to test longer term. Right now all of the cases are bundled into two tests with 3 cases each...

This makes it challenging to figure out what tests are more flaky than others and also we can't currently IGNORE the individual CASES.

Also --- for some reason and this is a question for folks reading this....

I can NOT FIGURE OUT how to IGNORE rstests --- if anyone knows how to do this let me know ! thanks...

#[ignore] 

It works with regular tests but not with rstests which is kind of annoying...

@IanManske

Copy link
Copy Markdown
Member

There appears to be some strange race conditions which are caused by running the tests in parallel

That was my suspicion as well (multiple tests all trying to read/write from the terminal). But even when running the tests serially (cargo test -j 1), the terminal output is still garbled. I assume our testing structure isn't meant to interact with the terminal which is why there previously weren't any tests for the Reedline struct.

A more future-proof solution is to use rexpect for testing, as it will create terminal files to isolate each test/process's stdin and stdout. Unfortunately, I think it only supports unix systems. PR #673 is related.

@fdncred

fdncred commented Jan 12, 2024

Copy link
Copy Markdown
Contributor Author

after reverting the tests run fine on my mac too with the exception of the system_clipboard feature which is just broke unrelated to the recent PRs.

kronberger-droid pushed a commit that referenced this pull request Jun 15, 2026
Re-applies #584 (reverted in #704); also fixes completions on a recalled history line being erased on the next key-press.
Adds regression tests.

Closes #1075
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.

3 participants