Skip to content

Commit d35a568

Browse files
committed
Install Influx on CI for Tests
1 parent 3160f79 commit d35a568

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ language: rust
22

33
sudo: required
44

5+
before_install:
6+
- wget https://dl.influxdata.com/influxdb/releases/influxdb_1.7.6_amd64.deb
7+
- sudo dpkg -i influxdb_1.7.6_amd64.deb
8+
- sudo influxd > $HOME/influx.log 2>&1 &
9+
510
branches:
611
only:
712
- master

tests/integration_tests.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ fn test_write_field() {
3636
let client = create_client();
3737
let query = InfluxDbQuery::write_query("weather").add_field("temperature", 82);
3838
let result = get_runtime().block_on(client.query(query));
39-
assert!(result.is_ok(), "Should be no error");
39+
assert!(
40+
result.is_ok(),
41+
format!("Should be no error: {}", result.unwrap_err())
42+
);
4043
}
4144

4245
#[test]
@@ -47,7 +50,10 @@ fn test_read() {
4750
let client = create_client();
4851
let query = InfluxDbQuery::raw_read_query("SELECT * FROM weather");
4952
let result = get_runtime().block_on(client.query(query));
50-
assert!(result.is_ok(), "Should be no error");
53+
assert!(
54+
result.is_ok(),
55+
format!("Should be no error: {}", result.unwrap_err())
56+
);
5157
assert!(
5258
!result.unwrap().contains("error"),
5359
"Data contained a database error"
@@ -72,5 +78,8 @@ fn test_json_query() {
7278
let query = InfluxDbQuery::raw_read_query("SELECT * FROM weather");
7379
let result = get_runtime().block_on(client.json_query::<Weather, _>(query));
7480

75-
assert!(result.is_ok(), "We could read from the DB");
81+
assert!(
82+
result.is_ok(),
83+
format!("We couldn't read from the DB: {}", result.unwrap_err())
84+
);
7685
}

0 commit comments

Comments
 (0)