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

[infra] Convert examples to bazel integration tests #1183

Merged
merged 17 commits into from
Sep 7, 2024

Conversation

restingbull
Copy link
Collaborator

@restingbull restingbull commented Jun 22, 2024

  1. Disable workspace test.
  2. Set .bazelrc for examples that need specific flags.
  3. Replace all existing integration tests with the new suites.
  4. Fix the version check for later versions of java to not crash with bazel 6. (java_test with bazel 6 and java >11 will fail without more work)

Implementation notes:

  • .bazelignore does not work with rules_bazel_integration_test. It must be via --deleted_packages
  • The automatic import of files fails as well
  • Adding more bazel versions is tedious.

fixes #1211, #1212

@restingbull restingbull force-pushed the restingbull/integration_test branch from 26fdfa6 to 970425e Compare June 22, 2024 19:11
@restingbull restingbull changed the title [integration testing] Add all exmaples as multi-version bazel integra… [infra] Convert examples to bazel integration tests Jun 22, 2024
@restingbull restingbull force-pushed the restingbull/integration_test branch 7 times, most recently from 17b630b to 128ab8b Compare June 23, 2024 21:16
@restingbull restingbull force-pushed the restingbull/integration_test branch 17 times, most recently from d79af18 to eb37daa Compare August 2, 2024 23:03
@restingbull restingbull force-pushed the restingbull/integration_test branch from 8c09e3e to db74e0d Compare August 21, 2024 22:50
@restingbull restingbull force-pushed the restingbull/integration_test branch 2 times, most recently from 61b98a3 to 8a761e5 Compare August 22, 2024 19:34
@restingbull restingbull force-pushed the restingbull/integration_test branch from 8a761e5 to a956c10 Compare August 22, 2024 23:17
- ubuntu1804
# - macos
# - windows re-enable when rules_bazel_integration_test can support custom test runner on windows.
test_flags:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@restingbull restingbull force-pushed the restingbull/integration_test branch from e5de023 to f399637 Compare September 6, 2024 18:49
@restingbull restingbull requested a review from Bencodes September 6, 2024 19:32
@@ -0,0 +1 @@
common --deleted_packages=examples/jetpack_compose,examples/jetpack_compose/app,examples/jetpack_compose/compose-ui,examples/jetpack_compose/stub,examples/jetpack_compose/stub/sun,examples/jetpack_compose/stub/sun/misc,examples/ksp,examples/ksp/third_party,examples/dagger,examples/dagger/third_party,examples/dagger/src,examples/dagger/src/coffee,examples/plugin,examples/plugin/src,examples/plugin/src/parcelize,examples/plugin/src/noarg,examples/plugin/src/serialization,examples/plugin/src/allopen,examples/plugin/src/sam_with_receiver,examples/plugin/src/allopennoarg,examples/trivial,examples/trivial/app,examples/android,examples/android/libKtAndroid,examples/android/libKtAndroid/res,examples/android/libKtAndroid/res/values,examples/android/libKtAndroid/res2,examples/android/libKtAndroid/res2/values,examples/android/libKtAndroid/src,examples/android/libKtAndroid/src/test,examples/android/libKtAndroid/src/test/java,examples/android/libKtAndroid/src/test/java/examples,examples/android/libKtAndroid/src/test/java/examples/android,examples/android/libKtAndroid/src/test/java/examples/android/lib,examples/android/libKtAndroid/src/main,examples/android/libKtAndroid/src/main/java,examples/android/libKtAndroid/src/main/java/examples,examples/android/libKtAndroid/src/main/java/examples/android,examples/android/libKtAndroid/src/main/java/examples/android/lib,examples/android/app,examples/android/app/src,examples/android/app/src/main,examples/android/exclude,examples/android/bzl,examples/android/components,examples/android/third_party,examples/android/libJava,examples/android/libJava/src,examples/android/libJava/src/main,examples/android/libJava/src/main/java,examples/android/libJava/src/main/java/examples,examples/android/libJava/src/main/java/examples/java,examples/android/libJava/src/main/java/examples/java/lib,examples/android/libAndroid,examples/android/libAndroid/res,examples/android/libAndroid/res/values-ja,examples/android/libAndroid/res/values-en-rCA,examples/android/libAndroid/res/values,examples/android/libAndroid/res/values-fr-rCA,examples/android/libAndroid/res/values-en-rGB,examples/android/libAndroid/res/values-en-rAU,examples/android/libAndroid/res/values-es,examples/android/libAndroid/src,examples/android/libAndroid/src/main,examples/android/libAndroid/src/main/java,examples/android/libAndroid/src/main/java/examples,examples/android/libAndroid/src/main/java/examples/android,examples/android/libAndroid/src/main/java/examples/android/lib2,examples/android/libAndroid/src/main/kotlin,examples/android/libAndroid/src/main/kotlin/examples,examples/android/libAndroid/src/main/kotlin/examples/android,examples/android/libAndroid/src/main/kotlin/examples/android/lib2,examples/deps,examples/deps/libKtAndroid1,examples/deps/libKtAndroid1/src,examples/deps/libKtAndroid1/src/main,examples/deps/libKtAndroid1/src/main/res,examples/deps/libKtAndroid1/src/main/res/values,examples/deps/libKtAndroid1/src/main/kt,examples/deps/libKtAndroid1/src/main/kt/examples,examples/deps/libKtAndroid1/src/main/kt/examples/deps,examples/deps/libKt2,examples/deps/libKt2/src,examples/deps/libKt2/src/main,examples/deps/libKt2/src/main/kt,examples/deps/libKt2/src/main/kt/examples,examples/deps/libKt2/src/main/kt/examples/deps,examples/deps/libKt3,examples/deps/libKt3/src,examples/deps/libKt3/src/main,examples/deps/libKt3/src/main/kt,examples/deps/libKt3/src/main/kt/examples,examples/deps/libKt3/src/main/kt/examples/deps,examples/deps/libKt4,examples/deps/libKt4/src,examples/deps/libKt4/src/main,examples/deps/libKt4/src/main/kt,examples/deps/libKt4/src/main/kt/examples,examples/deps/libKt4/src/main/kt/examples/deps,examples/deps/libAndroid2,examples/deps/libAndroid2/src,examples/deps/libAndroid2/src/main,examples/deps/libAndroid2/src/main/res,examples/deps/libAndroid2/src/main/res/values,examples/deps/libAndroid2/src/main/java,examples/deps/libAndroid2/src/main/java/examples,examples/deps/libAndroid2/src/main/java/examples/deps,examples/deps/libJava1,examples/deps/libJava1/src,examples/deps/libJava1/src/main,examples/deps/libJava1/src/main/java,examples/deps/libJava1/src/main/java/examples,examples/deps/libJava1/src/main/java/examples/deps,examples/deps/libAndroid3,examples/deps/libAndroid3/src,examples/deps/libAndroid3/src/main,examples/deps/libAndroid3/src/main/res,examples/deps/libAndroid3/src/main/res/values,examples/deps/libAndroid3/src/main/java,examples/deps/libAndroid3/src/main/java/examples,examples/deps/libAndroid3/src/main/java/examples/deps,examples/deps/libAndroid4,examples/deps/libAndroid4/src,examples/deps/libAndroid4/src/main,examples/deps/libAndroid4/src/main/res,examples/deps/libAndroid4/src/main/res/values,examples/deps/libAndroid4/src/main/java,examples/deps/libAndroid4/src/main/java/examples,examples/deps/libAndroid4/src/main/java/examples/deps,examples/deps/bzl,examples/deps/libKt1,examples/deps/libKt1/src,examples/deps/libKt1/src/main,examples/deps/libKt1/src/main/kt,examples/deps/libKt1/src/main/kt/examples,examples/deps/libKt1/src/main/kt/examples/deps,examples/deps/libKtAndroid2,examples/deps/libKtAndroid2/src,examples/deps/libKtAndroid2/src/main,examples/deps/libKtAndroid2/src/main/res,examples/deps/libKtAndroid2/src/main/res/values,examples/deps/libKtAndroid2/src/main/kt,examples/deps/libKtAndroid2/src/main/kt/examples,examples/deps/libKtAndroid2/src/main/kt/examples/deps,examples/deps/libKtAndroid4,examples/deps/libKtAndroid4/src,examples/deps/libKtAndroid4/src/main,examples/deps/libKtAndroid4/src/main/res,examples/deps/libKtAndroid4/src/main/res/values,examples/deps/libKtAndroid4/src/main/kt,examples/deps/libKtAndroid4/src/main/kt/examples,examples/deps/libKtAndroid4/src/main/kt/examples/deps,examples/deps/libKtAndroid3,examples/deps/libKtAndroid3/src,examples/deps/libKtAndroid3/src/main,examples/deps/libKtAndroid3/src/main/res,examples/deps/libKtAndroid3/src/main/res/values,examples/deps/libKtAndroid3/src/main/kt,examples/deps/libKtAndroid3/src/main/kt/examples,examples/deps/libKtAndroid3/src/main/kt/examples/deps,examples/deps/libJava2,examples/deps/libJava2/src,examples/deps/libJava2/src/main,examples/deps/libJava2/src/main/java,examples/deps/libJava2/src/main/java/examples,examples/deps/libJava2/src/main/java/examples/deps,examples/deps/libAndroid1,examples/deps/libAndroid1/src,examples/deps/libAndroid1/src/main,examples/deps/libAndroid1/src/main/res,examples/deps/libAndroid1/src/main/res/values,examples/deps/libAndroid1/src/main/java,examples/deps/libAndroid1/src/main/java/examples,examples/deps/libAndroid1/src/main/java/examples/deps,examples/deps/libJava3,examples/deps/libJava3/src,examples/deps/libJava3/src/main,examples/deps/libJava3/src/main/java,examples/deps/libJava3/src/main/java/examples,examples/deps/libJava3/src/main/java/examples/deps,examples/deps/libJava4,examples/deps/libJava4/src,examples/deps/libJava4/src/main,examples/deps/libJava4/src/main/java,examples/deps/libJava4/src/main/java/examples,examples/deps/libJava4/src/main/java/examples/deps,examples/node,examples/multiplex,examples/multiplex/exclude,examples/multiplex/src,examples/anvil,examples/anvil/app,examples/anvil/app/src,examples/anvil/app/src/androidTest,examples/anvil/app/src/androidTest/java,examples/anvil/app/src/androidTest/java/com,examples/anvil/app/src/androidTest/java/com/squareup,examples/anvil/app/src/androidTest/java/com/squareup/anvil,examples/anvil/app/src/androidTest/java/com/squareup/anvil/sample,examples/anvil/app/src/test,examples/anvil/app/src/test/java,examples/anvil/app/src/test/java/com,examples/anvil/app/src/test/java/com/squareup,examples/anvil/app/src/test/java/com/squareup/anvil,examples/anvil/app/src/test/java/com/squareup/anvil/sample,examples/anvil/app/src/main,examples/anvil/app/src/main/java,examples/anvil/app/src/main/java/com,examples/anvil/app/src/main/java/com/squareup,examples/anvil/app/src/main/java/com/squareup/anvil,examples/anvil/app/src/main/java/com/squareup/anvil/sample,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/mipmap-mdpi,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/drawable-v24,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/mipmap-hdpi,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/drawable,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/mipmap-xxxhdpi,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/values-ja,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/values-en-rCA,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/layout,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/mipmap-xxhdpi,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/values-night,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/values,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/values-fr-rCA,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/values-en-rGB,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/values-en-rAU,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/mipmap-xhdpi,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/values-es,examples/anvil/app/src/main/java/com/squareup/anvil/sample/res/mipmap-anydpi-v26,examples/anvil/library,examples/anvil/library/src,examples/anvil/library/src/main,examples/anvil/library/src/main/java,examples/anvil/library/src/main/java/com,examples/anvil/library/src/main/java/com/squareup,examples/anvil/library/src/main/java/com/squareup/anvil,examples/anvil/library/src/main/java/com/squareup/anvil/sample,examples/anvil/library/src/main/java/com/squareup/anvil/sample/father,examples/anvil/library/src/main/java/com/squareup/anvil/sample/mother,examples/anvil/third_party,examples/anvil/repro,examples/anvil/repro/src,examples/anvil/repro/src/main,examples/anvil/repro/src/main/java,examples/anvil/repro/src/main/java/com,examples/anvil/repro/src/main/java/com/repro,examples/anvil/repro/src/main/java/com/repro/lib,examples/anvil/scopes,examples/anvil/scopes/src,examples/anvil/scopes/src/main,examples/anvil/scopes/src/main/java,examples/anvil/scopes/src/main/java/com,examples/anvil/scopes/src/main/java/com/squareup,examples/anvil/scopes/src/main/java/com/squareup/scopes,examples/associates,examples/associates/projects,examples/associates/projects/core,examples/associates/projects/core/impl,examples/associates/projects/core/impl/src,examples/associates/projects/core/impl/src/test,examples/associates/projects/core/impl/src/test/kotlin,examples/associates/projects/core/impl/src/test/kotlin/core,examples/associates/projects/core/impl/src/test/kotlin/core/impl,examples/associates/projects/core/impl/src/main,examples/associates/projects/core/impl/src/main/kotlin,examples/associates/projects/core/impl/src/main/kotlin/core,examples/associates/projects/core/impl/src/main/kotlin/core/impl,examples/associates/projects/core/api,examples/associates/projects/core/api/src,examples/associates/projects/core/api/src/test,examples/associates/projects/core/api/src/test/kotlin,examples/associates/projects/core/api/src/test/kotlin/core,examples/associates/projects/core/api/src/test/kotlin/core/api,examples/associates/projects/core/api/src/main,examples/associates/projects/core/api/src/main/kotlin,examples/associates/projects/core/api/src/main/kotlin/core,examples/associates/projects/core/api/src/main/kotlin/core/api
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to just ignore the entire directory here instead of each individual package?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, no.

I tried that, but --deleted_packages only removes each package, not the subpackages.

@@ -8,12 +8,7 @@ bazel_dep(name = "bazel_skylib", version = "1.2.1")
bazel_dep(name = "rules_robolectric", version = "4.10.3", repo_name = "robolectric")
bazel_dep(name = "rules_java", version = "6.4.0")
bazel_dep(name = "platforms", version = "0.0.7")
bazel_dep(name = "rules_kotlin")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to build the examples without using the Bazel integration test path? If so then I'd maybe consider keeping the local_path_override so that people don't step into the examples to validate their changes only to realize that it's using the previous stable release of rules_kotlin rather than HEAD.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not without using the release_archive repository rule... which is getting tricky with the iteration they are doing on the repository namespacing. On the other hand, running bazel test //examples works just fine to validate changes.

@restingbull restingbull merged commit cff2e6f into master Sep 7, 2024
2 checks passed
@restingbull restingbull deleted the restingbull/integration_test branch September 7, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bazel CI] Error computing the main repository mapping: no such package '@@rules_kotlin//kotlin':
2 participants