Not localhost from coverage container
This commit is contained in:
parent
327eed8b97
commit
cd2c3a58c5
2 changed files with 29 additions and 10 deletions
|
|
@ -78,6 +78,8 @@ stages:
|
||||||
codecov_token: $(CODECOV_TOKEN_SECRET)
|
codecov_token: $(CODECOV_TOKEN_SECRET)
|
||||||
services:
|
services:
|
||||||
greenmail: greenmail
|
greenmail: greenmail
|
||||||
|
envs:
|
||||||
|
TEST_HOST: greenmail
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
repositories:
|
repositories:
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,14 @@ fn tls() -> native_tls::TlsConnector {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn session(user: &str) -> imap::Session<native_tls::TlsStream<TcpStream>> {
|
fn session(user: &str) -> imap::Session<native_tls::TlsStream<TcpStream>> {
|
||||||
let mut s = imap::connect("127.0.0.1:3993", "imap.example.com", &tls())
|
let mut s = imap::connect(
|
||||||
|
&format!(
|
||||||
|
"{}:3993",
|
||||||
|
std::env::var("TEST_HOST").unwrap_or("127.0.0.1".to_string())
|
||||||
|
),
|
||||||
|
"imap.example.com",
|
||||||
|
&tls(),
|
||||||
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.login(user, user)
|
.login(user, user)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
@ -25,7 +32,10 @@ fn session(user: &str) -> imap::Session<native_tls::TlsStream<TcpStream>> {
|
||||||
fn smtp(user: &str) -> lettre::SmtpTransport {
|
fn smtp(user: &str) -> lettre::SmtpTransport {
|
||||||
let creds = lettre::smtp::authentication::Credentials::new(user.to_string(), user.to_string());
|
let creds = lettre::smtp::authentication::Credentials::new(user.to_string(), user.to_string());
|
||||||
lettre::SmtpClient::new(
|
lettre::SmtpClient::new(
|
||||||
"127.0.0.1:3465",
|
&format!(
|
||||||
|
"{}:3465",
|
||||||
|
std::env::var("TEST_HOST").unwrap_or("127.0.0.1".to_string())
|
||||||
|
),
|
||||||
lettre::ClientSecurity::Wrapper(lettre::ClientTlsParameters {
|
lettre::ClientSecurity::Wrapper(lettre::ClientTlsParameters {
|
||||||
connector: tls(),
|
connector: tls(),
|
||||||
domain: "smpt.example.com".to_string(),
|
domain: "smpt.example.com".to_string(),
|
||||||
|
|
@ -38,14 +48,21 @@ fn smtp(user: &str) -> lettre::SmtpTransport {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn connect_insecure() {
|
fn connect_insecure() {
|
||||||
imap::connect_insecure("127.0.0.1:3143").unwrap();
|
imap::connect_insecure(&format!(
|
||||||
|
"{}:3143",
|
||||||
|
std::env::var("TEST_HOST").unwrap_or("127.0.0.1".to_string())
|
||||||
|
))
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
fn connect_insecure_then_secure() {
|
fn connect_insecure_then_secure() {
|
||||||
// ignored because of https://github.com/greenmail-mail-test/greenmail/issues/135
|
// ignored because of https://github.com/greenmail-mail-test/greenmail/issues/135
|
||||||
imap::connect_insecure("127.0.0.1:3143")
|
imap::connect_insecure(&format!(
|
||||||
|
"{}:3143",
|
||||||
|
std::env::var("TEST_HOST").unwrap_or("127.0.0.1".to_string())
|
||||||
|
))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.secure("imap.example.com", &tls())
|
.secure("imap.example.com", &tls())
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue