Skip to content
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

Open source internal test runner #495

Open
keith opened this issue Jul 16, 2019 · 3 comments
Open

Open source internal test runner #495

keith opened this issue Jul 16, 2019 · 3 comments
Labels
type: feature request New feature or request

Comments

@keith
Copy link
Member

keith commented Jul 16, 2019

Through a few conversations with Googlers I learned that internally a different test runner is used with rules_apple than the one that is publicly supported. I think because of this the open source version has a lack of testing which can cause issues that we likely wouldn't hit if the community shared the test runner that is currently used by Google. It would be great if that runner could be open sourced so that we could all contribute to it and improve a single tool, rather than being required to maintain our own test runners.

@sergiocampama sergiocampama added the type: feature request New feature or request label Jul 16, 2019
@sergiocampama
Copy link
Contributor

This is something outside of the rules_apple project, but given the lack of an appropriate channel to make this request, we can keep it here for tracking.

@keith
Copy link
Member Author

keith commented Sep 10, 2019

One thing I want to add to this is that iterating on / debugging xctestrunner is very difficult, here's the current steps I'm using:

  1. Clone xctestrunner, subpar, and rule_apple
  2. In your local xctestrunner checkout, merge these PRs: Update WORKSPACE for newer bazel versions google/xctestrunner#7 Rewrite imports for local builds google/xctestrunner#8
  3. In your local subpar clone, change here and add "--interpreter", "/usr/bin/python2.7", (this may vary depending on how your project is configured, without this xctestrunner will try to work with python3, and if you change the par_binary rule and add python_version = "PY2" it will try to use the python2 executable which doesn't exist on macOS)
  4. Build xctestrunner with bazel build //:ios_test_runner.par --override_repository=subpar=/path/to/subpar
  5. Copy bazel-bin/ios_test_runner.par to your local bazel repo
  6. In your repo's root BUILD file add:
filegroup(
    name = "foo",
    srcs = ["ios_test_runner.par"],
    visibility = ["//visibility:public"],
)
  1. In your local rules_apple clone (or your custom test runner that uses xctestrunner), change all uses of @xctestrunner//file to //:foo
  2. Test your code like normal passing --override_repository=build_bazel_rules_apple=/path/to/rules_apple

And repeat steps 4 and 5 whenever you make new changes to xctestrunner.

@jerrymarino
Copy link
Contributor

👍 in the meantime, I've forked to ios-bazel-users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants