redis test fix & beta/nightly ci

This commit fixes redis storage test, those were not ran before.
Also, introduces beta&nightly tests to CI
This commit is contained in:
Waffle 2020-08-12 23:53:58 +03:00
parent 3157305105
commit 981ba237c9
3 changed files with 37 additions and 15 deletions

View file

@ -27,23 +27,45 @@ jobs:
override: true
- name: Cargo clippy
run: cargo clippy --all --all-targets --all-features -- -D warnings
stable-test:
test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly
include:
- rust: stable
features: "--features \"redis-storage cbor-serializer bincode-serializer frunk-\""
- rust: beta
features: "--features \"redis-storage cbor-serializer bincode-serializer frunk-\""
- rust: nightly
features: "--all-features"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
toolchain: ${{ matrix.rust }}
override: true
- name: Setup redis
run: |
sudo apt install redis-server
redis-server --port 7777 > /dev/null &
redis-server --port 7778 > /dev/null &
redis-server --port 7779 > /dev/null &
- name: Cargo test
run: cargo test --all --all-features
- name: build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose ${{ matrix.features }}
- name: test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose ${{ matrix.features }}
build-example:
runs-on: ubuntu-latest
strategy:

View file

@ -68,3 +68,8 @@ tokio = { version = "0.2.21", features = ["fs", "stream", "rt-threaded", "macros
[package.metadata."docs.rs"]
all-features = true
[[test]]
name = "redis"
path = "tests/redis.rs"
required-features = ["redis-storage", "cbor-serializer", "bincode-serializer"]

View file

@ -1,5 +1,3 @@
#![cfg(feature = "redis_storage")]
use std::{
fmt::{Debug, Display},
future::Future,
@ -8,7 +6,6 @@ use std::{
use teloxide::dispatching::dialogue::{RedisStorage, Serializer, Storage};
#[tokio::test]
#[cfg(feature = "redis_storage")]
async fn test_redis_json() {
let storage = RedisStorage::open(
"redis://127.0.0.1:7777",
@ -19,7 +16,6 @@ async fn test_redis_json() {
test_redis(storage).await;
}
#[cfg(feature = "bincode_serializer")]
#[tokio::test]
async fn test_redis_bincode() {
let storage = RedisStorage::open(
@ -31,7 +27,6 @@ async fn test_redis_bincode() {
test_redis(storage).await;
}
#[cfg(feature = "cbor_serializer")]
#[tokio::test]
async fn test_redis_cbor() {
let storage = RedisStorage::open(