Use reserved .test TLD for unit tests (#36498)

`smtp.mydomain.test` is a real domain that resolves to something and
which is being connected to while running tests. Instead, use
[.test](https://en.wikipedia.org/wiki/.test) which is guaranteed to
never be registered on the internet, so all connections to it will fail
with NXDOMAIN dns error.
This commit is contained in:
silverwind
2026-01-30 20:42:32 +01:00
committed by GitHub
parent 208cbd5a6f
commit 2d1306291b
+4 -4
View File
@@ -11,12 +11,12 @@ import (
func Test_loadMailerFrom(t *testing.T) { func Test_loadMailerFrom(t *testing.T) {
kases := map[string]*Mailer{ kases := map[string]*Mailer{
"smtp.mydomain.com": { "smtp.mydomain.test": {
SMTPAddr: "smtp.mydomain.com", SMTPAddr: "smtp.mydomain.test",
SMTPPort: "465", SMTPPort: "465",
}, },
"smtp.mydomain.com:123": { "smtp.mydomain.test:123": {
SMTPAddr: "smtp.mydomain.com", SMTPAddr: "smtp.mydomain.test",
SMTPPort: "123", SMTPPort: "123",
}, },
":123": { ":123": {