Run tests on push

This commit is contained in:
Michael Zhang 2021-02-22 22:50:39 -06:00
parent 621ab2770a
commit f616cffef0
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
4 changed files with 22 additions and 5 deletions

View file

@ -3,7 +3,7 @@ on:
branches: branches:
- master - master
name: CI name: publish-documentation
jobs: jobs:
doc: doc:

19
.github/workflows/run-tests.yml vendored Normal file
View file

@ -0,0 +1,19 @@
on: [push]
name: run-tests
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: run tests
run: |
cargo test --all

View file

@ -345,7 +345,7 @@ mod tests {
r#"* 12 FETCH (FLAGS (\Seen) INTERNALDATE "17-Jul-1996 02:44:25 -0700" RFC822.SIZE 4286 ENVELOPE ("Wed, 17 Jul 1996 02:23:25 -0700 (PDT)" "IMAP4rev1 WG mtg summary and minutes" (("Terry Gray" NIL "gray" "cac.washington.edu")) (("Terry Gray" NIL "gray" "cac.washington.edu")) (("Terry Gray" NIL "gray" "cac.washington.edu")) ((NIL NIL "imap" "cac.washington.edu")) ((NIL NIL "minutes" "CNRI.Reston.VA.US") ("John Klensin" NIL "KLENSIN" "MIT.EDU")) NIL NIL "<B27397-0100000@cac.washington.edu>") BODY ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 3028 92))"#, r#"* 12 FETCH (FLAGS (\Seen) INTERNALDATE "17-Jul-1996 02:44:25 -0700" RFC822.SIZE 4286 ENVELOPE ("Wed, 17 Jul 1996 02:23:25 -0700 (PDT)" "IMAP4rev1 WG mtg summary and minutes" (("Terry Gray" NIL "gray" "cac.washington.edu")) (("Terry Gray" NIL "gray" "cac.washington.edu")) (("Terry Gray" NIL "gray" "cac.washington.edu")) ((NIL NIL "imap" "cac.washington.edu")) ((NIL NIL "minutes" "CNRI.Reston.VA.US") ("John Klensin" NIL "KLENSIN" "MIT.EDU")) NIL NIL "<B27397-0100000@cac.washington.edu>") BODY ("TEXT" "PLAIN" ("CHARSET" "US-ASCII") NIL NIL "7BIT" 3028 92))"#,
"\r\n", "\r\n",
)), )),
Ok(Response::Fetch(12, vec![AttributeValue])) Ok(Response::Fetch(12, vec![]))
); );
} }
} }

View file

@ -41,6 +41,7 @@ pub async fn run_mail(
// TODO: gracefully shut down connection // TODO: gracefully shut down connection
// just gonna drop the connection for now // just gonna drop the connection for now
// FUTURE TODO: possible to hash the connections and only reconn the ones that changed
debug!("dropping all connections..."); debug!("dropping all connections...");
for conn in curr_conn.drain(0..) { for conn in curr_conn.drain(0..) {
conn.abort(); conn.abort();
@ -101,9 +102,6 @@ async fn imap_main(acct: MailAccountConfig) -> Result<()> {
debug!("authentication successful!"); debug!("authentication successful!");
// debug!("sending CAPABILITY");
// let result = unauth.capabilities().await?;
loop { loop {
debug!("listing all emails..."); debug!("listing all emails...");
authed.list().await?; authed.list().await?;