-
Notifications
You must be signed in to change notification settings - Fork 810
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
Add 2 Redis instances/containers on GitHub Actions #1188
Comments
Based on my tests I found out that the tests will fail and return and this is the same thing I have found on github actions. now to run the tests with/without passwords we should split the redis group into two groups one with validation and the second without a validation, or we can create an ENV var and add it to test function like protected function isSecure()
{
return $_ENV['SECURE'];
}
/** @test */
public function valid_auth()
{
if(!$this->isSecure()) {
$this->markTestSkipped('This test needs a secure instance of redis');
}
$storage = new RedisStorage($this->getRedisHost(), $this->getAuthRedisPort(), 'secret');
$key = 'key';
$data = ['foo' => 1, 'bar' => new \DateTime()];
$storage->save($data, $key);
self::assertEquals(Collection::make($data), $storage->get($key));
}
public function get()
{
if($this->isSecure()) {
$this->markTestSkipped('This test needs an insecure instance of redis');
}
$storage = new RedisStorage($this->getRedisHost());
$key = 'key';
$data = ['foo' => 1, 'bar' => new \DateTime()];
$storage->save($data, $key);
self::assertEquals(Collection::make($data), $storage->get($key));
} You can find the workflow which I've created here https://github.com/zaherg/botman/blob/2.0/.github/workflows/test.yml and the results are here https://github.com/zaherg/botman/actions/runs/237445099 which is always connection refused (sadly) if anyone can test it locally at his computer and share his finding that would be helpful too. |
I updated my workflow to install redis-cli to verify that redis is working and can accept connections https://github.com/zaherg/botman/runs/1078750458?check_suite_focus=true, but I still got |
@crynobone Done everything is green https://github.com/zaherg/botman/actions/runs/242493405 But these are the things I have found and the recommendation we need to do:
Please review my code and if there is any question just let me know, my solution needs a refactoring from your end for sure but now we have a green tick as a start. |
At the moment we are only properly testing
RedisCache
andRedisStorage
using Travis-CI. It would be nice if we can have the same test running on GitHub Actions with the following requirements:6379
without password.6379
with passwordsecret
.The text was updated successfully, but these errors were encountered: