Skip to content

Add query suite integration tests for swift, actions, csharp, go, javascript, ruby, rust #19355

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

Merged
merged 5 commits into from
Apr 25, 2025

Conversation

tamasvajk
Copy link
Contributor

@tamasvajk tamasvajk commented Apr 23, 2025

This PR is adding integration tests to all languages to check query inclusion in query suites. The tests rely on changes to the internal repo, so integration tests are expected to be failing.

@github-actions github-actions bot added Java Swift C# JS Go Ruby Rust Pull requests that update Rust code Actions Analysis of GitHub Actions labels Apr 23, 2025
@tamasvajk tamasvajk changed the title Add query suite tests for swift with shared logic Add query suite integration tests for swift, actions, csharp, go, javascript, ruby, rust Apr 24, 2025
@tamasvajk tamasvajk marked this pull request as ready for review April 24, 2025 07:55
@Copilot Copilot AI review requested due to automatic review settings April 24, 2025 07:55
@tamasvajk tamasvajk requested review from a team as code owners April 24, 2025 07:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds integration tests for multiple languages (Java, Go, C#, Actions) to validate query suite inclusion with expected internal-repo changes causing test failures.

  • Simplified the test logic in Java by replacing file I/O with helper functions.
  • Added new integration tests for Go, C#, and Actions that mirror the Java test structure.

Reviewed Changes

Copilot reviewed 28 out of 44 changed files in this pull request and generated no comments.

File Description
java/ql/integration-tests/java/query-suite/test.py Replaces manual query resolution and file output with helper functions for checking query suites.
go/ql/integration-tests/query-suite/test.py Introduces integration tests for Go query suites using helper functions.
csharp/ql/integration-tests/posix/query-suite/test.py Introduces integration tests for C# query suites using helper functions.
actions/ql/integration-tests/query-suite/test.py Introduces integration tests for Actions query suites using helper functions.
Files not reviewed (16)
  • actions/ql/integration-tests/query-suite/actions-code-quality.qls.expected: Language not supported
  • actions/ql/integration-tests/query-suite/actions-code-scanning.qls.expected: Language not supported
  • actions/ql/integration-tests/query-suite/actions-security-and-quality.qls.expected: Language not supported
  • actions/ql/integration-tests/query-suite/actions-security-extended.qls.expected: Language not supported
  • actions/ql/integration-tests/query-suite/not_included_in_qls.expected: Language not supported
  • csharp/ql/integration-tests/posix/query-suite/csharp-code-quality.qls.expected: Language not supported
  • csharp/ql/integration-tests/posix/query-suite/csharp-code-scanning.qls.expected: Language not supported
  • csharp/ql/integration-tests/posix/query-suite/csharp-security-and-quality.qls.expected: Language not supported
  • csharp/ql/integration-tests/posix/query-suite/csharp-security-extended.qls.expected: Language not supported
  • csharp/ql/integration-tests/posix/query-suite/not_included_in_qls.expected: Language not supported
  • go/ql/integration-tests/query-suite/go-code-quality.qls.expected: Language not supported
  • go/ql/integration-tests/query-suite/go-code-scanning.qls.expected: Language not supported
  • go/ql/integration-tests/query-suite/go-security-and-quality.qls.expected: Language not supported
  • go/ql/integration-tests/query-suite/go-security-extended.qls.expected: Language not supported
  • go/ql/integration-tests/query-suite/not_included_in_qls.expected: Language not supported
  • javascript/ql/integration-tests/query-suite/javascript-code-quality.qls.expected: Language not supported

redsun82
redsun82 previously approved these changes Apr 24, 2025
Copy link
Contributor

@redsun82 redsun82 left a comment

Choose a reason for hiding this comment

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

Minor cosmetic nits, but LGTM!

Copy link
Contributor

@owen-mc owen-mc left a comment

Choose a reason for hiding this comment

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

Go LGTM (I didn't check every single query though...)

@redsun82 redsun82 added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Apr 24, 2025
michaelnebel
michaelnebel previously approved these changes Apr 24, 2025
Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

C# 👍
Are these tests added, such that we don't accidentally add/remove queries to a suite?

@tamasvajk tamasvajk force-pushed the test/add-query-suite-tests branch from 650f187 to 20f7f1e Compare April 24, 2025 08:31
@tamasvajk
Copy link
Contributor Author

Are these tests added, such that we don't accidentally add/remove queries to a suite?

Yes. There are more changes to query suites recently due to the code-quality work that we're doing. I'm also planning on changing the code-quality query suites to not list individual query IDs, and having these tests in place help in not making accidental mistakes.

@tamasvajk tamasvajk force-pushed the test/add-query-suite-tests branch from d03cd33 to 998e64b Compare April 25, 2025 12:06
Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

LGTM!

@tamasvajk tamasvajk merged commit 3437210 into github:main Apr 25, 2025
39 of 76 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Analysis of GitHub Actions C# depends on internal PR This PR should only be merged in sync with an internal Semmle PR Go Java JS Ruby Rust Pull requests that update Rust code Swift
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants