remove codecov

This commit is contained in:
Bevan Hunt 2020-01-11 03:49:04 +00:00
parent b1ac4ba59f
commit 6943992d9a
3 changed files with 7 additions and 46 deletions

View File

@ -13,23 +13,3 @@ rust:
matrix:
allow_failures:
- rust: nightly
before_cache: |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
cargo install cargo-tarpaulin -f
fi
script:
- cargo clean
- cargo build
- cargo test
after_success: |
if [[ "$TRAVIS_RUST_VERSION" == stable ]]; then
# Uncomment the following line for coveralls.io
# cargo tarpaulin --ciserver travis-ci --coveralls $TRAVIS_JOB_ID
# Uncomment the following two lines create and upload a report for codecov.io
cargo tarpaulin --out Xml
bash <(curl -s https://codecov.io/bash)
fi

View File

@ -2,7 +2,6 @@
[![crates.io](https://meritbadge.herokuapp.com/broker)](https://crates.io/crates/broker)
[![Build Status](https://travis-ci.org/apibillme/broker.svg?branch=master)](https://travis-ci.org/apibillme/broker)
[![codecov](https://codecov.io/gh/apibillme/broker/branch/master/graph/badge.svg)](https://codecov.io/gh/apibillme/broker)
### Purpose

View File

@ -116,6 +116,13 @@ fn insert_success() {
let token: broker::Token = serde_json::from_str(&res).unwrap();
let bearer = format!("Bearer {}", token.jwt);
let client = reqwest::blocking::Client::new();
let res = client.post("http://localhost:8002/insert")
.json(&event)
.send().unwrap()
.status();
assert_eq!(res, 401);
let client = reqwest::blocking::Client::new();
let res = client.post("http://localhost:8002/insert")
.header("Authorization", bearer)
@ -125,31 +132,6 @@ fn insert_success() {
assert_eq!(res, 200);
}
#[test]
#[cfg_attr(tarpaulin, skip)]
fn insert_failure_no_auth_header() {
let (tx, rx) = mpsc::channel();
thread::spawn(move || {
let id = uuid::Uuid::new_v4();
let p = format!("./tmp/{}", id.to_string());
let c = broker::Config{port: "8003".to_owned(), origin: "http://localhost:3000".to_owned(), expiry: 3600, secret: "secret".to_owned(), save_path: p};
let _ = run_app(tx, c);
});
let _ = rx.recv().unwrap();
let event = json!({"event": "test", "collection_id": "3ca76743-8d99-4d3f-b85c-633ea456f90c", "timestamp": 1578667309, "data": "{}"});
let client = reqwest::blocking::Client::new();
let res = client.post("http://localhost:8003/insert")
.json(&event)
.send().unwrap()
.status();
assert_eq!(res, 401);
}
#[test]
#[cfg_attr(tarpaulin, skip)]
fn collection_failure_no_auth_header() {