mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-22 06:45:37 +01:00
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:
parent
3157305105
commit
981ba237c9
3 changed files with 37 additions and 15 deletions
42
.github/workflows/ci.yml
vendored
42
.github/workflows/ci.yml
vendored
|
@ -27,23 +27,45 @@ jobs:
|
||||||
override: true
|
override: true
|
||||||
- name: Cargo clippy
|
- name: Cargo clippy
|
||||||
run: cargo clippy --all --all-targets --all-features -- -D warnings
|
run: cargo clippy --all --all-targets --all-features -- -D warnings
|
||||||
stable-test:
|
|
||||||
|
test:
|
||||||
runs-on: ubuntu-latest
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- uses: actions-rs/toolchain@v1
|
||||||
with:
|
with:
|
||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: stable
|
toolchain: ${{ matrix.rust }}
|
||||||
override: true
|
override: true
|
||||||
- name: Setup redis
|
|
||||||
run: |
|
- name: build
|
||||||
sudo apt install redis-server
|
uses: actions-rs/cargo@v1
|
||||||
redis-server --port 7777 > /dev/null &
|
with:
|
||||||
redis-server --port 7778 > /dev/null &
|
command: build
|
||||||
redis-server --port 7779 > /dev/null &
|
args: --verbose ${{ matrix.features }}
|
||||||
- name: Cargo test
|
|
||||||
run: cargo test --all --all-features
|
- name: test
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: test
|
||||||
|
args: --verbose ${{ matrix.features }}
|
||||||
|
|
||||||
build-example:
|
build-example:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
@ -68,3 +68,8 @@ tokio = { version = "0.2.21", features = ["fs", "stream", "rt-threaded", "macros
|
||||||
|
|
||||||
[package.metadata."docs.rs"]
|
[package.metadata."docs.rs"]
|
||||||
all-features = true
|
all-features = true
|
||||||
|
|
||||||
|
[[test]]
|
||||||
|
name = "redis"
|
||||||
|
path = "tests/redis.rs"
|
||||||
|
required-features = ["redis-storage", "cbor-serializer", "bincode-serializer"]
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#![cfg(feature = "redis_storage")]
|
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
fmt::{Debug, Display},
|
fmt::{Debug, Display},
|
||||||
future::Future,
|
future::Future,
|
||||||
|
@ -8,7 +6,6 @@ use std::{
|
||||||
use teloxide::dispatching::dialogue::{RedisStorage, Serializer, Storage};
|
use teloxide::dispatching::dialogue::{RedisStorage, Serializer, Storage};
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[cfg(feature = "redis_storage")]
|
|
||||||
async fn test_redis_json() {
|
async fn test_redis_json() {
|
||||||
let storage = RedisStorage::open(
|
let storage = RedisStorage::open(
|
||||||
"redis://127.0.0.1:7777",
|
"redis://127.0.0.1:7777",
|
||||||
|
@ -19,7 +16,6 @@ async fn test_redis_json() {
|
||||||
test_redis(storage).await;
|
test_redis(storage).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "bincode_serializer")]
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_redis_bincode() {
|
async fn test_redis_bincode() {
|
||||||
let storage = RedisStorage::open(
|
let storage = RedisStorage::open(
|
||||||
|
@ -31,7 +27,6 @@ async fn test_redis_bincode() {
|
||||||
test_redis(storage).await;
|
test_redis(storage).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "cbor_serializer")]
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_redis_cbor() {
|
async fn test_redis_cbor() {
|
||||||
let storage = RedisStorage::open(
|
let storage = RedisStorage::open(
|
||||||
|
|
Loading…
Add table
Reference in a new issue