-
Notifications
You must be signed in to change notification settings - Fork 272
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
fix for test watches in update
#4413
Conversation
a failing transcript `add-test-watch-roundtrip` and an ok-looking transcript for `update-test-watch-roundtrip`; though noting that the test gains a type signature.
not sure if this is actually better
…bugging. we could alternatively move the creation and cleanup back into the Unison code, conditional on an environment variable we set to suppress cleanup.
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.
I see at least one place where your transcript reports that there is a current bug. But I see another where it seems to be adding the double type annotation that I thought should be fixed b this PR. So I'm confused.
@@ -0,0 +1,15 @@ | |||
```ucm:hide | |||
.> builtins.mergeio |
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.
Off topic: why do both builtins.merge
and builtins.mergeio
exist, and is there a reason to prefer mergeio
here?
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.
Good question. builtins.merge
just includes "builtins" (from the point of view of the runtime). So that's primitive types like Int
, Nat
, primitive terms like Nat.+
.
builtins.mergeio
, includes all the "builtins" but also all the user-defined types that UCM commands rely on. So Doc
, Test.Result
, Author
, etc. It is defined with actual Unison code embedded in ucm, and parsed/typechecked when you call the command.
IO
used to be a user-defined ability, hence the name "builtins.mergeio", and the rest of the Unison-based definitions were lumped in there as well for convenience. Today, IO
is a primitive ability, so you actually get it from builtins.merge
, and not from builtins.mergeio
😓
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.
builtins.merge
takes less time to execute, so I prefer that when I can get away with it, since 2-3 seconds per transcript (or whatever it takes to run the parser/typechecker like builtins.mergeio
must do) gets multiplied by 100 transcripts or whatever.
Kind of like:
builtins.merge
fastest
builtins.mergeio
fast-ish
project.create
clone @unison/base 😑
(Actually skipping all of them is the fastest.)
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.
I was mistaken, Test.Result
is in the smaller builtins.merge
.
.> view foo | ||
|
||
foo : [Result] | ||
foo : [Result] |
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 is still showing the incorrect output, isn't it?
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.
Confusing; sorry.
Yes, but that transcript doesn't involve update
. So it's tracked by loose end #4417.
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.
Oh I see the "we don't want this to happen" is saying that this is a bug but the transcript is just capturing that it currently happens, right?
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.
Right. I don't think you will actually run into #4417 unless you are manually putting type signatures on your tests as in that transcript though. Let me know if you find otherwise!
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.
Looks to be an improvement, though tests will probably continue to be not very usable until #4417 is completed.
A few changes to fix #4405:
update
to render tests (terms having type[Test.Result]
) as test watches when recreating a scratch file.prettyUnisonFile
-ing those tests, since it is added automatically by the parser.Also fixes #4410.
Overview
Changes the round-trip under
update
offrom
or worse,
to
Test coverage
Adds a couple of transcripts.
Loose ends
add
andview
/edit
#4417 (unison-src/transcripts/update-test-to-non-test.md)