Truncate the temp db before running test_complete_index. Should close #17.
This commit is contained in:
parent
4a195eb1b7
commit
d9ef4fed53
@ -43,8 +43,8 @@ test:stable:
|
|||||||
image: "rust"
|
image: "rust"
|
||||||
script:
|
script:
|
||||||
- rustc --version && cargo --version
|
- rustc --version && cargo --version
|
||||||
- cargo build --all
|
- cargo build
|
||||||
- cargo test -j 1 --all --verbose
|
- cargo test -j 1 --verbose
|
||||||
|
|
||||||
test:nightly:
|
test:nightly:
|
||||||
# Nightly
|
# Nightly
|
||||||
|
|||||||
@ -142,6 +142,7 @@ mod tests {
|
|||||||
|
|
||||||
use rss;
|
use rss;
|
||||||
use models::Source;
|
use models::Source;
|
||||||
|
use database::connection;
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::BufReader;
|
use std::io::BufReader;
|
||||||
@ -191,6 +192,16 @@ mod tests {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
{
|
||||||
|
// Reset the database into a clean state.
|
||||||
|
// Test share a Temp file db I think.
|
||||||
|
let db = connection();
|
||||||
|
let con = db.get().unwrap();
|
||||||
|
con.execute("DELETE FROM episode").unwrap();
|
||||||
|
con.execute("DELETE FROM podcast").unwrap();
|
||||||
|
con.execute("DELETE FROM source").unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
let mut feeds: Vec<_> = urls.iter()
|
let mut feeds: Vec<_> = urls.iter()
|
||||||
.map(|&(path, url)| {
|
.map(|&(path, url)| {
|
||||||
// Create and insert a Source into db
|
// Create and insert a Source into db
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user