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

[receiver/sqlquery] sqlserver integration tests, improved coverage #36922

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Grandys
Copy link
Contributor

@Grandys Grandys commented Dec 22, 2024

Description

Mainly added test for sqlserver, plus added coverage for logs (as requested in comment)

Link to tracking issue

Fixes #29695

Testing

Main changes:

  • Added metrics tests for SqlServer
  • Covered MySql, SqlServer and Oracle for logs

Improvements:

  • To avoid repetitions, changed approach to "parameterized" tests - run the same test flow for different database engines (for logs only).
  • Do not hardcode "localhost" and host port, get these values from testcontainers.
  • Replaced inserting test values into the database from running CLI commands in the container to executing SQL commands.
  • Updated Oracle init script to use otel schema instead of sys.

Important: For Oracle and SQL Server, tests are skipped (tested locally) - I expect them to fail due to #27577 (which was not fixed but closed due to inactivity).

@Grandys Grandys requested review from dmitryax, crobert-1 and a team as code owners December 22, 2024 21:42
@github-actions github-actions bot added the receiver/sqlquery SQL query receiver label Dec 22, 2024
@songy23 songy23 added the Run Windows Enable running windows test on a PR label Dec 23, 2024
@Grandys Grandys force-pushed the sqlqueryreciver-improve-integration-tests branch from 2c462cc to 1bdd23c Compare December 23, 2024 14:12
Copy link

linux-foundation-easycla bot commented Dec 23, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@Grandys Grandys force-pushed the sqlqueryreciver-improve-integration-tests branch 3 times, most recently from dc3dc6e to 1bdd23c Compare December 23, 2024 17:53
@Grandys Grandys force-pushed the sqlqueryreciver-improve-integration-tests branch from 3044d01 to bba41e4 Compare December 31, 2024 14:28
BodyColumn: "body",
AttributeColumns: []string{"attribute"},
},
type DbEngine struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would inexpert that type just to be clear about it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@atoulme Thank you for your comment. I'm not entirely clear on what you mean. Are you suggesting that I should simply rename this type to DbEngineUnderTest?

@Grandys Grandys requested a review from atoulme January 4, 2025 12:16
@Grandys Grandys force-pushed the sqlqueryreciver-improve-integration-tests branch from bba41e4 to da67353 Compare January 4, 2025 15:20
@crobert-1 crobert-1 added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Jan 6, 2025
@crobert-1
Copy link
Member

Failing extension test is frequency of #37079, I've added a reference there. Unrelated to this change.

@@ -0,0 +1,12 @@
FROM mcr.microsoft.com/mssql/server:2017-latest
Copy link
Member

Choose a reason for hiding this comment

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

Can we use a more recent version of the SQL Server docker image?

/opt/mssql/bin/sqlservr &

# Wait for SQL Server to start
sleep 30s
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to have a more concrete/time sensitive check for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
receiver/sqlquery SQL query receiver Run Windows Enable running windows test on a PR Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sqlqueryreceiver lacks integration tests for mssql
5 participants