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

Cross-build the tests module #1463

Merged
merged 4 commits into from
Apr 22, 2022
Merged

Cross-build the tests module #1463

merged 4 commits into from
Apr 22, 2022

Conversation

cb372
Copy link
Member

@cb372 cb372 commented Apr 22, 2022

  • Remove dependency on config module, as that's not cross-built
    • Move the relevant tests to the config module
    • Also improve one of the tests by adding a missing config file
  • Move all uses of the @service macro to src/test/scala-2/
  • Minor syntax changes to satisfy the Scala 3 compiler

The next step will be to gradually rewrite the uses of @service in the tests to use sourcegen instead. But that will require some thought, as the tests use many combinations of serialization type (Avro/AvroWithSchema/Protobuf), compression (Gzip/Identity) and idiomatic endpoints (true/false). It's not immediately clear how we can support that, as sbt-mu-srcgen only lets you configure those on a per-project basis.

We can't cross-build the config module because it depends on pureconfig,
so we need to remove this inter-module dependency in order to
cross-build the tests module.

Moved the relevant tests into the config module.

Also fixed one of the tests that didn't make much sense, and added a
missing config file.
Anything that uses the `@service` annotation was moved to
src/test/scala-2/.
Now the tests module is cross-built, we can move these tests out of the
rpc-service module
@@ -62,8 +62,6 @@ class DropwizardMetricsTests extends ScalaCheckSuite {
(registry.getTimers().asScala.toMap, registry.timer(gaugeName).getCount)
case Counter =>
(registry.getCounters().asScala.toMap, registry.counter(gaugeName).getCount)
case _ =>
Copy link
Member Author

Choose a reason for hiding this comment

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

The Scala 3 compiler helpfully pointed out that this case is unreachable!

@@ -0,0 +1 @@
rpc.server.port = 51111
Copy link
Contributor

Choose a reason for hiding this comment

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

where is this used @cb372 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@cb372 cb372 merged commit 7400bec into main Apr 22, 2022
@cb372 cb372 deleted the cross-build-tests branch April 22, 2022 16:00
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.

2 participants