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

TST: trace event migration backward compatibility e2e tests #1264

Conversation

chenqi0805
Copy link
Collaborator

Description

This PR

  • refactors existing trace e2e tests
  • adds additional tests to cover compatibility between event record type and classic record type (ExportTraceServiceRequest)

Issues Resolved

Resolves #1158

Check List

  • New functionality includes testing.
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@chenqi0805 chenqi0805 requested a review from a team as a code owner April 4, 2022 17:15
Signed-off-by: Qi Chen <[email protected]>
Signed-off-by: Qi Chen <[email protected]>
Signed-off-by: Qi Chen <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2022

Codecov Report

Merging #1264 (456fdeb) into main (5d3ff6d) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #1264   +/-   ##
=========================================
  Coverage     94.08%   94.08%           
  Complexity     1156     1156           
=========================================
  Files           162      162           
  Lines          3248     3248           
  Branches        263      263           
=========================================
  Hits           3056     3056           
  Misses          138      138           
  Partials         54       54           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d3ff6d...456fdeb. Read the comment docs.

@@ -24,5 +24,8 @@ jobs:
java-version: ${{ matrix.java }}
- name: Checkout Data-Prepper
uses: actions/checkout@v2
- name: Run raw-span compatibility end-to-end tests with Gradle
run: ./gradlew :e2e-test:trace:rawSpanCompatibilityEndToEndTest
Copy link
Member

Choose a reason for hiding this comment

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

I propose that we keep the rawSpanCompatibilityEndToEndTest. It can just be a task which depends on the other two tests.

This approach allows for developers to have few test commands to run locally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So the current rawSpanCompatibilityEndToEndTest is renamed as rawSpanOTLPLatestReleaseCompatibilityEndToEndTest. I only added a similar test with event type named rawSpanEventLatestReleaseCompatibilityEndToEndTest. Can you specify what two other tests this should depend on?

Copy link
Member

Choose a reason for hiding this comment

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

You have renamed rawSpanCompatibilityEndToEndTest to rawSpanOTLPLatestReleaseCompatibilityEndToEndTest. So keep that.

But, you can also add a task named rawSpanCompatibilityEndToEndTest. Just make it depend on rawSpanOTLPLatestReleaseCompatibilityEndToEndTest and rawSpanEventLatestReleaseCompatibilityEndToEndTest.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tried the following:

task rawSpanEndToEndTest(type: Test) {
    dependsOn rawSpanOTLPEndToEndTest
    dependsOn rawSpanOTLPAndEventEndToEndTest
    rawSpanOTLPEndToEndTest.doLast {
        sleep(10 * 1000)
    }
    rawSpanOTLPAndEventEndToEndTest.mustRunAfter(rawSpanOTLPEndToEndTest)
}

but unfortunately the container conflict between the two tasks remains:

Status 409: {"message":"Conflict. The container name \"/dataprepper2\" is already in use by container \"d3f18cb07a9ef6625aa830db8dbaf27f85029d5ae7a23967162bec7a3b2c6154\". You have to remove (or rename) that container to be able to reuse that name."}

Copy link
Member

Choose a reason for hiding this comment

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

OK - it appears it isn't quite so easy due to using Docker. Maybe we can improve this later.

name: "entry-pipeline"
processor:
- otel_trace_raw:
root_span_flush_delay: 1 # TODO: remove after 1.1 release
Copy link
Member

Choose a reason for hiding this comment

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

Apparently this was never removed after the 1.1 release. Maybe we should remove it now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the catch!

@@ -1,15 +1,20 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
* SPDX-License-Identifier: Apache-2.0
Copy link
Member

Choose a reason for hiding this comment

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

Please use the shorter license file.

Unless you copied this code from another project, the shorter license file is the correct one.

name: "entry-pipeline"
processor:
- otel_trace_raw:
root_span_flush_delay: 1 # TODO: remove after 1.1 release
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is out-dated. Can we delete it?

// Wait for data to flow through pipeline and be indexed by ES
await().atMost(10, TimeUnit.SECONDS).untilAsserted(
await().atLeast(6, TimeUnit.SECONDS).atMost(20, TimeUnit.SECONDS).untilAsserted(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to increase the time out to 20 seconds?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is just add some cushion for async assertion due to removal of L116:

Thread.sleep(6000);

Comment on lines 2 to 9
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
Copy link
Contributor

Choose a reason for hiding this comment

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

This license header is out of date. Please keep the original header:

/*
 * Copyright OpenSearch Contributors
 * SPDX-License-Identifier: Apache-2.0
 */

def createServiceMapDataPrepperOTLP2Task = createDataPrepperDockerContainer(
"serviceMapDataPrepper2", "dataprepper2", 21891, 4901, "/app/${SERVICE_MAP_PIPELINE_YAML}")

// TODO: replace with Event type in 2.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's provide a link to a Github issue and include a reference to this work in that issue. This way we can easily track the work required when we pick it up.

// wait for data-preppers to be ready
doFirst {
sleep(10*1000)
def createEndToEndTest(final String testName, final String includeTestsMatchPattern,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice work removing the repetitive code blocks.

Signed-off-by: Qi Chen <[email protected]>
@chenqi0805 chenqi0805 merged commit de15772 into opensearch-project:main Apr 7, 2022
@chenqi0805 chenqi0805 deleted the tst/trace-event-migration-backward-compatibility-e2e-tests branch April 7, 2022 14:32
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.

Provide a migration path to using Events for Trace data
4 participants