From 8ae32224095d44df493e2ecc7206c136e9b1db3e Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Mon, 14 Mar 2022 19:28:20 +0400 Subject: [PATCH] Disable redis tests outside of CI ...to not annoy people like me who don't have redis open while testing --- .github/workflows/ci.yml | 3 +++ tests/redis.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28110882..387c6070 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,9 @@ on: name: Continuous integration +env: + RUSTFLAGS: "--cfg CI_REDIS" + jobs: style: runs-on: ubuntu-latest diff --git a/tests/redis.rs b/tests/redis.rs index 2e011596..dff537ec 100644 --- a/tests/redis.rs +++ b/tests/redis.rs @@ -5,6 +5,7 @@ use std::{ use teloxide::dispatching::dialogue::{RedisStorage, RedisStorageError, Serializer, Storage}; #[tokio::test] +#[cfg_attr(not(CI_REDIS), ignore)] async fn test_redis_json() { let storage = RedisStorage::open( "redis://127.0.0.1:7777", @@ -16,6 +17,7 @@ async fn test_redis_json() { } #[tokio::test] +#[cfg_attr(not(CI_REDIS), ignore)] async fn test_redis_bincode() { let storage = RedisStorage::open( "redis://127.0.0.1:7778", @@ -27,6 +29,7 @@ async fn test_redis_bincode() { } #[tokio::test] +#[cfg_attr(not(CI_REDIS), ignore)] async fn test_redis_cbor() { let storage = RedisStorage::open( "redis://127.0.0.1:7779",