update github actions to test against cyrus-imapd as well as greenmail

This commit is contained in:
Edward Rudd 2022-07-15 22:43:51 -04:00 committed by Jon Gjengset
parent 602ff8e4af
commit 38a4030ff9
3 changed files with 37 additions and 4 deletions

View file

@ -6,7 +6,7 @@ name: cargo test
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
name: ${{ matrix.toolchain }} name: greenmail/${{ matrix.toolchain }}
strategy: strategy:
matrix: matrix:
toolchain: [stable, beta, nightly] toolchain: [stable, beta, nightly]
@ -32,3 +32,28 @@ jobs:
- 3995:3995 - 3995:3995
env: env:
GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose" GREENMAIL_OPTS: "-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose"
test_cyrus:
runs-on: ubuntu-latest
name: cyrus/${{ matrix.toolchain }}
strategy:
matrix:
toolchain: [stable, beta, nightly]
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
- uses: actions/checkout@v2
- name: cargo test
uses: actions-rs/cargo@v1
with:
command: test
args: -- --ignored
services:
cyrus_imapd:
image: outoforder/cyrus-imapd-tester:latest
ports:
- 3025:25
- 3143:143
- 3465:465
- 3993:993

View file

@ -92,7 +92,14 @@ easiest way to do that is with Docker:
```console ```console
$ docker pull greenmail/standalone:1.6.8 $ docker pull greenmail/standalone:1.6.8
$ docker run -t -i -e GREENMAIL_OPTS='-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose' -p 3025:3025 -p 3110:3110 -p 3143:3143 -p 3465:3465 -p 3993:3993 -p 3995:3995 greenmail/standalone:1.6.3 $ docker run -it --rm -e GREENMAIL_OPTS='-Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.auth.disabled -Dgreenmail.verbose' -p 3025:3025 -p 3110:3110 -p 3143:3143 -p 3465:3465 -p 3993:3993 -p 3995:3995 greenmail/standalone:1.6.3
```
Another alternative is to test against cyrus imapd which is a more complete IMAP implementation that greenmail (supporting quotas and ACLs).
```
$ docker pull outoforder/cyrus-imapd-tester
$ docker run -it --rm -p 3025:25 -p 3110:110 -p 3143:143 -p 3465:465 -p 3993:993 outoforder/cyrus-imapd-tester:latest
``` ```
## License ## License

View file

@ -25,7 +25,7 @@ fn test_host() -> String {
fn test_smtp_host() -> String { fn test_smtp_host() -> String {
std::env::var("TEST_SMTP_HOST") std::env::var("TEST_SMTP_HOST")
.unwrap_or_else(|| std::env::var("TEST_HOST").unwrap_or("127.0.0.1".to_string())) .unwrap_or_else(|_| std::env::var("TEST_HOST").unwrap_or("127.0.0.1".to_string()))
} }
fn test_imap_port() -> u16 { fn test_imap_port() -> u16 {
@ -101,6 +101,7 @@ fn smtp(user: &str) -> lettre::SmtpTransport {
} }
#[test] #[test]
#[ignore]
fn connect_insecure_then_secure() { fn connect_insecure_then_secure() {
let host = test_host(); let host = test_host();
// ignored because of https://github.com/greenmail-mail-test/greenmail/issues/135 // ignored because of https://github.com/greenmail-mail-test/greenmail/issues/135
@ -342,7 +343,7 @@ fn list() {
let mut s = session("readonly-test@localhost"); let mut s = session("readonly-test@localhost");
s.select("INBOX").unwrap(); s.select("INBOX").unwrap();
let subdirs = s.list(None, Some("%")).unwrap(); let subdirs = s.list(None, Some("%")).unwrap();
assert_eq!(subdirs.len(), 0); assert_eq!(subdirs.len(), 1);
// TODO: make a subdir // TODO: make a subdir
} }