zio icon indicating copy to clipboard operation
zio copied to clipboard

[zio-test-sbt] Use IntelliJRenderer when running sbt test inside Teamcity

Open ak0rz opened this issue 2 years ago • 3 comments

To propagate test statuses to CI correctly, zio-test-sbt may use IntelliJRenderer when it's running incide teamcity build

see https://github.com/zio/zio/blob/49fddba0e709528083da2f995fdc6537015f3bb9/test-sbt/js-jvm/src/main/scala/zio/test/sbt/ZTestEvent.scala#L26-L28

ak0rz avatar Aug 24 '22 16:08 ak0rz

@swoogles Can you take a look at this?

adamgfraser avatar Aug 30 '22 01:08 adamgfraser

@ya-goodfella Deciding how to tackle this.

Looks like checking for the TEAMCITY_VERSION environment variable is the default way to recognize if you're running in that environment?

We're a bit wary of adding custom logic to recognize different CI environments. What do you think about letting users specify which Renderer to use through some configuration channel?

Also, are you maintaining any open source projects that use Teamcity? I haven't worked with it before, and it might be nice if I could push to a branch on a project that was already configured with it.

swoogles avatar Aug 30 '22 03:08 swoogles

@swoogles

Looks like checking for the TEAMCITY_VERSION environment variable is the default way to recognize if you're running in that environment?

Yep, looks like it's a preferred way of checking Teamcity environment.

We're a bit wary of adding custom logic to recognize different CI environments. What do you think about letting users specify which Renderer to use through some configuration channel?

I'm ok with that, that's what I was thinking about too - a composable and configurable renderers; although I don't know which way of doing might be user-friendly. AFAIK, sbt doesn't provide a way to configure TestFramework (apart from providing a class names)

Also, are you maintaining any open source projects that use Teamcity? I haven't worked with it before, and it might be nice if I could push to a branch on a project that was already configured with it.

Unfortunately no, but there is free to use Docker image of it Or you can mention me when tests with environment variables would pass, I'm here to help.

ak0rz avatar Aug 31 '22 13:08 ak0rz

@ya-goodfella Try passing -renderer "intellij" to your SBT test commands now , and make sure that this covers your needs! You'll need to use a snapshot build or wait till 2.0.6 is released.

swoogles avatar Dec 21 '22 16:12 swoogles