slack-ruby / slack-ruby-client

A Ruby and command-line client for the Slack Web, Real Time Messaging and Event APIs.
MIT License
1.19k stars 214 forks source link

Only run integration tests in integration_test job #445

Closed duffn closed 1 year ago

duffn commented 1 year ago

This:

1) skips the integration test job entirely in GitHub Actions if there isn't a Slack token in secrets.

It's particularly annoying to use the absence of a secret to control job flow. This is based on the answer here https://stackoverflow.com/questions/70249519/how-to-check-if-a-secret-variable-is-empty-in-if-conditional-github-actions

I went with the option of skipping the job entirely so it doesn't need to even checkout or install dependencies if the secret isn't there, but can be convinced this isn't the right approach.

Hidden secret, allows integration tests:

Screen Shot 2023-03-15 at 11 18 56 AM

No secret, skips integration tests:

Screen Shot 2023-03-15 at 11 19 11 AM

2) only runs the integration directory tests on this job

I'm not 100% sure why both SPEC and SPEC_OPTS are required here, but it doesn't work with either/or but only both

Closes #444

dangerpr-bot commented 1 year ago
1 Warning
:warning: Unless you're refactoring existing code or improving documentation, please update CHANGELOG.md.

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

* [#445](https://github.com/slack-ruby/slack-ruby-client/pull/445): Only run integration tests in integration_test job - [@duffn](https://github.com/duffn).

Generated by :no_entry_sign: Danger