-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Reenable terminal tests on CI #5018
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ final class JLineTerminal extends java.io.Closeable { | |
// Logger.getLogger("org.jline").setLevel(Level.FINEST) | ||
|
||
private val terminal = TerminalBuilder.builder() | ||
.dumb(false) // fail early if not able to create a terminal | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am against enabling this by default. Last time I tried, the dumb terminal was very limited and I don't want to expose it to users. E.g.
You can experiment with dumb terminal with these changes: diff --git a/compiler/src/dotty/tools/repl/JLineTerminal.scala b/compiler/src/dotty/tools/repl/JLineTerminal.scala
index 22e44e4a5..9c33a7b87 100644
--- a/compiler/src/dotty/tools/repl/JLineTerminal.scala
+++ b/compiler/src/dotty/tools/repl/JLineTerminal.scala
@@ -17,9 +17,12 @@ final class JLineTerminal extends java.io.Closeable {
// import java.util.logging.{Logger, Level}
// Logger.getLogger("org.jline").setLevel(Level.FINEST)
- private val terminal = TerminalBuilder.builder()
- .dumb(false) // fail early if not able to create a terminal
- .build()
+ // private val terminal = TerminalBuilder.builder()
+ // .dumb(false) // fail early if not able to create a terminal
+ // .build()
+ import java.lang.System
+ private val terminal =
+ new org.jline.terminal.impl.DumbTerminal(System.in, System.out)
private val history = new DefaultHistory
private def blue(str: String) = Console.BLUE + str + Console.RESET I would be Ok to make this configurable in order to use dumb terminal in tests. However, we clearly need to document what can be tested There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I just wanted to enable it as fallback if there is no alternative. Even a dumb REPL seems better than no REPL at all? Tho we should probably warn the user to fix their terminal. Anyway, supporting dumb terminals for users is a separate question. |
||
.build() | ||
private val history = new DefaultHistory | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
> run | ||
> 'set initialCommands := "1 + 1" ' | ||
# FIXME: does not work on the CI | ||
#> console | ||
> console | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A more extensive REPL test would be nice. I don't know to what extent we can test the REPL with scripted tests. E.g. can we test something like #3007? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIUC, this already tests that starting the console succeeds, which seems why @SzymonPajzert was interested for #4933. If we want to connect something to the actual terminal, give commands and wait for responses, one could use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This need to be reverted