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

No test left behind: stop skipping tests #26088

Open
ajcvickers opened this issue Sep 17, 2021 · 2 comments
Open

No test left behind: stop skipping tests #26088

ajcvickers opened this issue Sep 17, 2021 · 2 comments

Comments

@ajcvickers
Copy link
Member

ajcvickers commented Sep 17, 2021

Ideas for better catching behavior changes in the product code. Specifically:

  • Detect when a negative case stops failing
  • Detect when a negative case starts failing in a different way

Fundamental approach: don't skip tests.

In NorthwindAggregateOperatorsQueryTests, we had:

  • Negative cases that were no longer failing
  • Negative cases that were skipped for all providers, but worked on some. For example:
    • Failed on relational, but passed on in-memory
    • Failed on relational, but passed on Cosmos
    • Failed on SQL Server, but passed on SQLite
  • Negative cases that failed in different ways on different providers

Specifics:

  • If a test throws, catch the exception
    • Where feasible, also validate the exception message or error number
  • Always call base where possible, rather than repeating the query in an overridden test
  • Add a standard comment where we have a bug or enhancement tracking the issue. For example:
    • // Contains over subquery. Issue #17246.
  • Always have an AssertSql call in Cosmos and SQL Server tests
    • Where we expect a provider-specific class to verify SQL, then add a test that checks all test methods are overridden.
@ajcvickers
Copy link
Member Author

We should also consider when and when not to use Skip.

@smitpatel
Copy link
Member

We should consider when and when not to use Task.CompletedTask.
Skip should be only used for test which we intend to fix in future.

ajcvickers added a commit that referenced this issue Oct 17, 2021
Part of #26088 and #17235

Ideas for better catching behavior changes in the product code. Specifically:
- Detect when a negative case stops failing
- Detect when a negative case starts failing in a different way

Fundamental approach: don't skip tests.

In NorthwindAggregateOperatorsQueryTests, we had:
- Negative cases that were no longer failing
- Negative cases that were skipped for all providers, but worked on some. For example:
  - Failed on relational, but passed on in-memory
  - Failed on relational, but passed on Cosmos
  - Failed on SQL Server, but passed on SQLite
- Negative cases that failed in different ways on different providers

Specifics:
- If a test throws, catch the exception
  - Were feasible, also validate the exception message or error number
- Always call base where possible, rather than repeating the query in an overriden test
- Add a standard comment where we have a bug or enhancement tracking the issue. For example:
  - `// Contains over subquery. Issue #17246.`
- Always have an `AssertSql` call in Cosmos and SQL Server tests
  - Where we expect a provider-specific class to verify SQL, then add a test that checks all test methods are overriden.
ajcvickers added a commit that referenced this issue Oct 25, 2021
ajcvickers added a commit that referenced this issue Oct 27, 2021
@ajcvickers ajcvickers self-assigned this Nov 7, 2021
ajcvickers added a commit that referenced this issue Nov 7, 2021
ajcvickers added a commit that referenced this issue Nov 18, 2021
@ajcvickers ajcvickers changed the title Call base in skipped tests No test left behind: stop skipping tests Nov 20, 2021
ajcvickers added a commit that referenced this issue Dec 12, 2021
ajcvickers added a commit that referenced this issue Dec 12, 2021
ajcvickers added a commit that referenced this issue Dec 20, 2021
#26088 for Northwind query tests.

Also fixes #7016: Support "non-rooted" query expressions in compiled queries.
ajcvickers added a commit that referenced this issue Dec 21, 2021
#26088 for Gears query tests.
ajcvickers added a commit that referenced this issue Jan 4, 2022
#26088 for Gears query tests.
ajcvickers added a commit that referenced this issue Jan 4, 2022
#26088 for Northwind query tests.

Also fixes #7016: Support "non-rooted" query expressions in compiled queries.
ajcvickers added a commit that referenced this issue Jan 4, 2022
#26088 for Northwind query tests.

Also fixes #7016: Support "non-rooted" query expressions in compiled queries.
@ajcvickers ajcvickers removed their assignment Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants