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

Improve reliability of tests #643

Merged
merged 11 commits into from
Sep 1, 2021

Conversation

owais
Copy link
Contributor

@owais owais commented Aug 31, 2021

Description

Update some tests to use more deterministic methods of testing in memory
spans. This helps the core repo pass tests after adding Windows to CI
matrix.

Type of change

Please delete options that are not relevant.

  • Dev/Tooling enchancement

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

This PR has been split out of #531 in order to not block the core Windows PR. We can merge core Windows PR along with this one and continue to work on contrib Windows.

  • Updated Tests

Does This PR Require a Core Repo Change?

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@owais owais requested review from a team, codeboten and srikanthccv and removed request for a team August 31, 2021 12:45
@owais owais added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Aug 31, 2021
Update some tests to use more deterministic methods of testing in memory
spans. This helps the core repo pass tests after adding Windows to CI
matrix.
@owais owais changed the title More deterministic tests Improve reliability of tests Aug 31, 2021
self.assertEqual(2, len(spans))
span1, span2 = spans
self.assertEqual(span1.name, "Elasticsearch/test-index")
Copy link
Member

Choose a reason for hiding this comment

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

Why delete this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not asserted by the span.by_name() call. It returns a span if found, otherwise throws an assertion error. Perhaps I should rename it to by_name_or_fail() or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

LMK if that makes sense. I can follow up with another PR.

@@ -122,7 +122,8 @@ envlist =
py3{6,7,8,9}-test-instrumentation-grpc

; opentelemetry-instrumentation-sqlalchemy
py3{6,7,8,9}-test-instrumentation-sqlalchemy{11,14}
py3{6,7}-test-instrumentation-sqlalchemy{11}
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment explaining why we do this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ocelotl ocelotl merged commit cc57aac into open-telemetry:main Sep 1, 2021
@owais owais deleted the more-deterministic-tests branch September 1, 2021 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants