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

tests: Skip testing deprecated non-async client methods in latest Elastic.Clients.Elasticsearch versions #2569

Merged
merged 5 commits into from
Jun 22, 2024

Conversation

nr-ahemsath
Copy link
Member

In the latest Elastic.Clients.Elasticsearch versions, non-async methods are deprecated. We previously ignored the deprecation warnings and continued testing these methods. This PR:

  1. Uses preprocessor directives to avoid compiling the non-async methods in the latest ConsoleMF TFMs (net481 and net8.0), which are tied to the latest Elastic.Clients.Elasticsearch library versions.
  2. Adds logic to the test code to skip testing the non-async methods for the latest version of Elastic.Clients.Elasticsearch
  3. Modifies the Connect and GenerateError methods to be "async all the way" in order to use PingSync() instead of Ping() for those methods.

This also introduces the use of a 3rd-party library XUnit.SkippableFact to skip tests based on runtime conditions. I wanted to be explicit that we were skipping test cases rather than just having them pass without actually testing anything.

Copy link
Member

@tippmar-nr tippmar-nr left a comment

Choose a reason for hiding this comment

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

Looks good!

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.86%. Comparing base (a6c4e74) to head (0eff085).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2569      +/-   ##
==========================================
+ Coverage   80.59%   80.86%   +0.26%     
==========================================
  Files         459      458       -1     
  Lines       28927    28985      +58     
  Branches     3177     3184       +7     
==========================================
+ Hits        23315    23439     +124     
+ Misses       4822     4756      -66     
  Partials      790      790              
Flag Coverage Δ
Agent 81.78% <ø> (+0.29%) ⬆️
Profiler 72.59% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 169 files with indirect coverage changes

@nr-ahemsath nr-ahemsath merged commit 7a86f61 into main Jun 22, 2024
93 checks passed
@nr-ahemsath nr-ahemsath deleted the tests/remove-deprecated-elasticsearch-methods branch June 22, 2024 00:40
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.

None yet

4 participants