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

Skip spotless and other checks in CI test step #8142

Merged
merged 16 commits into from
Apr 4, 2023

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Mar 27, 2023

Currently we run spotless and other checks for each of the parallel test steps which seems wasteful. Here is an attempt to run only the tests in given partition without any extra checks in the test step and run all the checks in the build step.

// since we are splitting these tasks across different github action jobs
val enabled = testPartitionCounter++ % 4 == testPartition
if (enabled) {
tasks.withType<Test>().configureEach {
Copy link
Member

Choose a reason for hiding this comment

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

Just to make sure: that includes the gradle test suites, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does. For example in https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/runs/4530824015/jobs/7980235634?pr=8142 when you open Test step you can see the command line which includes the test tasks passed to gradle. It includes :instrumentation:spring:spring-jms:spring-jms-2.0:javaagent:testReceiveSpansDisabled which is a test suite.
Definitely one of the risks with this is that it is not straightforward and there is a chance that some test might be never run if this logic turns out to be faulty.

var taskPath = task.project.path + ":" + task.name
// smoke tests are run separately
// :instrumentation:test runs all instrumentation tests
if (taskPath != ":smoke-tests:test" && taskPath != ":instrumentation:test") {
Copy link
Member

Choose a reason for hiding this comment

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

Does anyone use :instrumentation:tests? (I'd be good with removing it)

Copy link
Member

Choose a reason for hiding this comment

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

Let's remove it 👍

.github/workflows/build-common.yml Outdated Show resolved Hide resolved
@@ -63,9 +75,8 @@ jobs:
GE_CACHE_PASSWORD: ${{ secrets.GE_CACHE_PASSWORD }}
with:
arguments: >
test
Copy link
Contributor Author

Choose a reason for hiding this comment

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

when we migrated to test suites we stopped running some of the latest deps tests because they now depend on check instead of test, that is why this pr also includes some changes to tests

Copy link
Member

Choose a reason for hiding this comment

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

😱 great catch

@laurit laurit marked this pull request as ready for review April 3, 2023 19:30
@laurit laurit requested a review from a team April 3, 2023 19:30
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

nice!

.github/workflows/build-common.yml Show resolved Hide resolved
.github/workflows/build-common.yml Outdated Show resolved Hide resolved
.github/workflows/build-common.yml Show resolved Hide resolved
@trask trask merged commit 8fba02e into open-telemetry:main Apr 4, 2023
@laurit laurit deleted the ci-parallel-test branch July 6, 2023 17:30
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.

3 participants