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"
|
||||
script:
|
||||
- rustc --version && cargo --version
|
||||
- cargo build --all
|
||||
- cargo test -j 1 --all --verbose
|
||||
- cargo build
|
||||
- cargo test -j 1 --verbose
|
||||
|
||||
test:nightly:
|
||||
# Nightly
|
||||
|
||||
@ -142,6 +142,7 @@ mod tests {
|
||||
|
||||
use rss;
|
||||
use models::Source;
|
||||
use database::connection;
|
||||
|
||||
use std::fs;
|
||||
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()
|
||||
.map(|&(path, url)| {
|
||||
// Create and insert a Source into db
|
||||
|
||||
Loading…
Reference in New Issue
Block a user