I need to test our mail server in a clojure project. To do that I thought I would open a mock up server and send emails using this mock up server and check if they are sent. For that I found for example this server.
To be able to execute
lein test
and have each test tested, I need to run the SMTP server once before each test and once at the end. I can also run the server in a fixture and exit it after each test. Since i am running about 100 tests, it does not make sense to always start and shutdown the server.
My approaches that i thought are the following:
1 - I write a bash script that starts the (mockup) mail server, runs lein test, then shuts down the server. (Here I will lost the ease of executing lein test in the IDE)
2- I could have a fixture checking if the server is started and start it if its not. However after the test finished the server will still be running which is not desired.
What is the correct way to solve this problem?
Can I order the tests in clojure such that the last test file shutsdown the mail server ?
Aucun commentaire:
Enregistrer un commentaire