Comments (6)
Thanks, glad that it was useful!
The current tests are written using the go test
way, no other conventions. Just add them .travis.yml 's "script:" section if you want them to run after each PR.
It would be good to write tests for the two bugs #44 and #42 so they won't happen again. So that would be the HELO/EHLO commands and DATA command.
So, to start you off - have a look at server_test.go (just committed). It has an example for how to mock net.Conn . (There are other tests such as tests/guerrilla_test.go which tests the server as a package and serve_test.go which test as a command line program where you may get examples form)
This issue also carries a bounty reward - so it would be wonderful to reward for the two cases (or maybe you can do more?)
from go-guerrilla.
Cool! I'll likely give it a peek this weekend.
from go-guerrilla.
@flashmob Hiya, so I've been working on this a little bit and noticed that the cmd handling logic isn't abstracted at all (so it's a little difficult to atomically test) – I'm wondering if abstracting that to a function would be out-of-bounds or welcome (so the PR would be an abstraction of that function and test cases for all the handled commands).
Also noticed that there's "coverage" on some functions in server.go from client_test.go but that there are uncaught errors in the tests. Is there a slack/irc channel for development that it would be good to ask specific questions about? Or are the issue threads the best place?
from go-guerrilla.
Oh, also the response types that are currently strings could be statically typed by net/http.Response.StatusCode* but I don't know if the project wants that dependency.
from go-guerrilla.
Hi, Brandon! @dapaxx has made some progress on the "enhanced status codes" SMTP extension - it has been merged to master recently. If you have a way to improve these - please let us know. Yes, using an int for the code is better than using a string.
The cmd handling logic was introduced by @remohammadi - maybe he already had solved the problem for how to test this individually, maybe he has some advice for us?
If you want to refactor - do you want to do something like this?: - http://stackoverflow.com/questions/35827147/cobra-viper-golang-how-to-test-subcommands
As for slack/irc, then the project may be too small for that - but asking in the issues is OK for now.
Finally, you're welcome to refactor something that makes something more testable, any day!
from go-guerrilla.
Looks like @dapaxx has done some great work on this front. I don't have as much free time right now as I was hoping so I'm going to contribute to coverage via unit tests for some of the abstract functions and dive deeper when I have the bandwidth.
from go-guerrilla.
Related Issues (20)
- Some service say the generated e-mail is not valid HOT 1
- Feature request: Delay before sending a message HOT 2
- Runtime error: index out of range HOT 2
- CPU restriction to 1 HOT 1
- Little bug corrected for windows HOT 4
- AWS S3 Backend HOT 1
- Need larger emails to be supported
- Windows Compilation HOT 1
- I need a build a service for expiring e-mail HOT 1
- Email subject is empty when subject contains blue heart symbol HOT 2
- Allow to pre-fill the "To" (e-mail) and "Subject" fields using URL arguments HOT 1
- GuerrilaMail doesn't send email HOT 3
- Only part of domains was blocked that organisation?
- is this project abandoned? HOT 4
- Is the project and bounties still active? HOT 5
- start error error while initializing the backend: processor [mysql] not found
- How to get email content when email is sent to server? HOT 1
- AUTH LOGIN Support
- No more sending emails :'( HOT 1
- HELP is not compliant with RFC 2034 (ENHANCEDSTATUSCODES) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-guerrilla.