-
Notifications
You must be signed in to change notification settings - Fork 94
Conversation
Once we like the basic shape, I'll do a copybara import into google3 and mark some files as integrated (eg. the concatjs node impl) and we can do more review internally. |
internal/ts_test.bzl
Outdated
substitutions = { | ||
"TMPL_runfiles_path": "/".join([".."] * config_segments), | ||
"TMPL_files": TMPL_files, | ||
"TMPL_workspace_name": ctx.workspace_name, |
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 didn't find this in the template. Where is it used?
internal/ts_test.bzl
Outdated
"TMPL_workspace_name": ctx.workspace_name, | ||
}) | ||
|
||
ctx.actions.write( |
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.
Is the plan to have a karma_web_test_suite() or ts_web_test_suite() to run all of these Karma scripts?
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.
That's what I want to understand from you :)
Right now each ts_test
just runs karma on the conf file it produces
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.
My original plan was that ts_test()
s don't run by themselves because starting multiple Karma instances is expensive. I wanted to have a top-level rule/script that starts the Karma instance and shares the instance across all ts_test()
s that it depends on.
But as you said "Doesn't yet include any way to discover and connect to an existing karma instance, so it starts a bunch of browser windows, one per test target. Can add that later". So I'm OK with the current way it is.
examples/testing/BUILD.bazel
Outdated
testonly = 1, | ||
) | ||
|
||
ts_test( |
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 doesn't run tests by itself right?
Which rule consumes this?
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.
Yes, this does run the tests. I'll add a README about 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.
LGTM
Some things to note about this approach:
build_bazel_rules_typescript_karma_deps
that has all our runtime deps, so we don't mix with the users node_modules, and they don't even need toyarn add karma
. That's good so we know we run a karma version that works with our rules./cc @bowenni