Open apolkingg8 opened 3 years ago
@kelvin-wong Please share your past experience about this kind of e2e test.
To simplify the e2e test for mailgun
, there is a project that works well to mock the service. We could include this service in our project for e2e testing.
@kelvin-wong Please share your past experience about this kind of e2e test.
- It depends on Dockerfile of mail gun issue.
Hi @solomondefi-dev I don't find the Dockerfile of mail gun issue. Can you share the issue number? Thanks.
You're right, I was thinking of #22
We'll need a new issue for the mail tester docker file
Just take a look at the Go project. If we don't need to test mailgun
itself, this issue is pretty easy. We can add use a simple SQLite in the e2e test and don't need to import the full project into Solomon.
Just take a look at the Go project. If we don't need to test
mailgun
itself, this issue is pretty easy. We can add use a simple SQLite in the e2e test and don't need to import the full project into Solomon.
Hi @apolkingg8, In that case, does this issue still depend on #22? I think you are already working on this issue now.
Not sure. I don't think we need a Dockerfile in this case, but it's still ok to have one.
We can add use a simple SQLite in the e2e test and don't need to import the full project into Solomon.
If I understand correctly, this is probably fine for integration tests. Since e2e tests should be run against skaffold and match production as close as possible, it could be nice to include an image for the mail tester in the test cluster, so we don't have to mock anything.
It should be really fast, either we can prebuild an image and upload to Github/Docker cloud, or have a simple Dockerfile that loads it from the github reposity and builds.
If I understand correctly, this is probably fine for integration tests. Since e2e tests should be run against skaffold and match production as close as possible, it could be nice to include an image for the mail tester in the test cluster, so we don't have to mock anything.
But about the exist project, it's like a mailgun mock
, isn't it? If we want to match production as close as possible, that means we need to test "the mail is in the inbox", that's hard work. If we trust mailgun service and just check we send correct args to mailgun, it's should be done in the unit test and we don't need this issue.
I do trust mailgun, but they unfortunately do not provide a good sandbox for testing, it's pretty limited. The mail tester has a few benefits over mocking locally:
localhost:3050/mail
)It seems that since the mail-tester project was created, Mailgun themselves have built something similar: https://github.com/mailgun/mailgun-go/blob/master/mock.go
That appears to have many more features, but it's also a lot more complicated and I think it doesn't have a local mail viewer for development.
Fork from #17. Currently, we do some simple unit test to ensure the
send()
method is triggered, but thesend()
method is not tested yet. Need amailgun
test env to impl the E2E test.