-
Notifications
You must be signed in to change notification settings - Fork 17
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
Move all tests over to Rely #59
Conversation
# windows_408: { OCAML_VERSION: "4.08", platform: Windows, vmImage: windows-latest, CACHE_FOLDER: $(Pipeline.Workspace)\cache }, | ||
windows_406: { OCAML_VERSION: "4.06", platform: Windows, vmImage: windows-latest, CACHE_FOLDER: $(Pipeline.Workspace)\cache }, | ||
windows_407: { OCAML_VERSION: "4.07", platform: Windows, vmImage: windows-latest, CACHE_FOLDER: $(Pipeline.Workspace)\cache }, | ||
windows_408: { OCAML_VERSION: "4.08", platform: Windows, vmImage: windows-latest, CACHE_FOLDER: $(Pipeline.Workspace)\cache }, |
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.
😍 we can dev it on windows.
"@esy-ocaml/[email protected]@d41d8cd9" | ||
], | ||
"devDependencies": [ "[email protected]@d41d8cd9" ] | ||
}, |
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.
So much deps removed maybe we can go below < 400 MO of cache now.
|
||
Alcotest.run(~argv=[|"--verbose --color"|], "Brisk", [("Core", core)]); |
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.
It is conserved ? "Brisk", [("Core", core)]
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 could nest the describe
some more, do you want this @wokalski ?
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.
Not relevant anymore. It's a relict of the distant past.
expectInt( | ||
~label="The dispose should not have been run yet", | ||
0, | ||
effectDisposeCallCount^, |
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.
Missing ?
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 think it's on line 953, the diff is a bit hard to read here.
@@ -221,7 +222,8 @@ module EmptyComponentWithAlwaysEffect = { | |||
}; | |||
|
|||
module EmptyComponentWithOnMountEffect = { | |||
let%component make = (~onEffect, ~onEffectDispose, ()) => { | |||
let%component make = | |||
(~onEffect: unit => unit, ~onEffectDispose: unit => unit, ()) => { |
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.
Why are this type annotation needed ?
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.
It complained about not being able to generalize a type, but this is only used in tests so it doesn't bleed anywhere.
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.
weird!
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.
amazing. It's a lot of changes but I spotted only one mistake - there's a duplicate test.
# windows_408: { OCAML_VERSION: "4.08", platform: Windows, vmImage: windows-latest, CACHE_FOLDER: $(Pipeline.Workspace)\cache }, | ||
windows_406: { OCAML_VERSION: "4.06", platform: Windows, vmImage: windows-latest, CACHE_FOLDER: $(Pipeline.Workspace)\cache }, | ||
windows_407: { OCAML_VERSION: "4.07", platform: Windows, vmImage: windows-latest, CACHE_FOLDER: $(Pipeline.Workspace)\cache }, | ||
windows_408: { OCAML_VERSION: "4.08", platform: Windows, vmImage: windows-latest, CACHE_FOLDER: $(Pipeline.Workspace)\cache }, |
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.
🥳
* outputs junit xml to the provided filepath, most CI solutions have | ||
* integration with the junit xml format */ | ||
Default, | ||
JUnit("./junit.xml"), |
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.
🤩
type mount = list(testMountEntry); | ||
|
||
type testHostItem('a) = | ||
| MountElement(mountElement): testHostItem(mount); |
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 think this wrapper is redundant?
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 not new, TestHelpers.re
is the old Assert.re
but I removed some stuff at the end and added a new function.
type testHostItem('a) = | ||
| MountElement(mountElement): testHostItem(mount); | ||
|
||
type testState = { |
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.
It'd be great to move mountLog
to testState
. During insertNode
child nodes should get a ref of mountLog
to add updates to later. It'll make the tests less error prone. It's not a change for now though.
MountChild(root, div, 0), | ||
]); | ||
}) | ||
}); |
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.
👍
test("The effect should've been run", ({expect}) => { | ||
state := state^ |> executeSideEffects; | ||
|
||
expect.int(effectCallCount^).toBe(1); |
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.
👍
({expect}) => { | ||
expect.int(effectDisposeCallCount^).toBe(1) | ||
}); | ||
}); |
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.
👍
({expect}) => { | ||
expect.int(effectDisposeCallCount^).toBe(1) | ||
}); | ||
}); |
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.
👍
0, | ||
effectDisposeCallCount^, | ||
); | ||
expect.int(effectCallCount^).toBe(1); |
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.
Great addition @ulrikstrid 👏
MountChild(div, box("ImABox1"), 1), | ||
]); | ||
}); | ||
}); |
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 allows us to test on Windows and we also get nice jUnit reporting