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

Suppress deprecation warnings when running tests on the CI #410

Closed
wants to merge 1 commit into from

Conversation

schinery
Copy link
Contributor

@schinery schinery commented Jun 7, 2022

No description provided.

@dangerpr-bot
Copy link

1 Warning
⚠️ Unless you're refactoring existing code or improving documentation, please update CHANGELOG.md.

Here's an example of a CHANGELOG.md entry:

* [#410](https://github.com/slack-ruby/slack-ruby-client/pull/410): Suppress deprecation warnings when running tests on the ci - [@schinery](https://github.com/schinery).

Generated by 🚫 Danger

@dblock
Copy link
Collaborator

dblock commented Jun 9, 2022

This seems a bit excessive, and will swallow all warnings, including useful ones.

The failing test runs the command line CLI and checks for output, wanting to ensure that it only contains what we expect. But it is broken if there are warnings:

2022-06-05T17:59:03.6640113Z   1) Slack globals requires --slack-api-token
2022-06-05T17:59:03.6640576Z      Failure/Error:
2022-06-05T17:59:03.6640915Z        expect(err).to(
2022-06-05T17:59:03.6641229Z          start_with(
2022-06-05T17:59:03.6641833Z            'error: parse error: Set Slack API token via --slack-api-token or SLACK_API_TOKEN.'
2022-06-05T17:59:03.6642284Z          )
2022-06-05T17:59:03.6642578Z        )
2022-06-05T17:59:03.6642787Z 
2022-06-05T17:59:03.6643831Z        expected "Top level ::CompositeIO is deprecated, require 'multipart/post' and use `Multipart::Post::CompositeR...lack [global options] auth test \n\n\n\nDESCRIPTION\n    Checks authentication & identity. \n\n\n\n" to start with "error: parse error: Set Slack API token via --slack-api-token or SLACK_API_TOKEN."
2022-06-05T17:59:03.6644725Z      # ./spec/slack/slack_spec.rb:35:in `block (3 levels) in <top (required)>'

I would edit the failing tests to break up the output line-by-line, and ensure that these include the expected output instead of start_with.

@schinery
Copy link
Contributor Author

schinery commented Jun 9, 2022

@dblock the problem is (as put here) the issue is with the 2 tests that are doing json = Slack::Messages::Message.new(JSON[#{command}]) as command is expected to be a just a JSON string but now also contains the Top level ::CompositeIO is deprecated... warnings.

I don't see an easy way around this.

@dblock
Copy link
Collaborator

dblock commented Jun 9, 2022

@schinery I wonder whether the deprecation warnings are going to stderr and the expected output to stdout?

@schinery schinery closed this Jan 17, 2023
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.

3 participants