Coder Social home page Coder Social logo

Improve Test Coverage about caddy HOT 9 CLOSED

caddyserver avatar caddyserver commented on June 3, 2024
Improve Test Coverage

from caddy.

Comments (9)

mholt avatar mholt commented on June 3, 2024

Yes indeed. You are more than welcome to write tests. I'm actually writing an example test file for the rewrite middleware right now (it's simple; a good starting point).

from caddy.

mholt avatar mholt commented on June 3, 2024

@j-mcnally See b2ee663

from caddy.

hackintoshrao avatar hackintoshrao commented on June 3, 2024

I'm keen on writing tests ..What would the best place to start writing tests ?

from caddy.

mholt avatar mholt commented on June 3, 2024

@Karthic-Hackintosh Welcome! Any of the middlewares here: https://github.com/mholt/caddy/tree/master/middleware

Each middleware has an associated "setup" file that also needs testing: https://github.com/mholt/caddy/tree/master/config/setup - all these do is parse the configuration and set up the middleware so it's ready to use.

Those would be great places to start.

from caddy.

miko-code avatar miko-code commented on June 3, 2024

Hi ,
Are you still need help to test stuff ?
Where i can find the example test you wrote ?

from caddy.

mholt avatar mholt commented on June 3, 2024

@miko-code We've made lots of progress, but still need help. For example, https://github.com/mholt/caddy/blob/master/config/setup/root.go needs tests. You can see an example of similar tests here (though these are more complicated): https://github.com/mholt/caddy/blob/master/config/setup/tls_test.go

root.go is super-easy to test and only needs one or a few assertions I think.

from caddy.

Makpoc avatar Makpoc commented on June 3, 2024

Hi,
As with everyone before me in this thread I would also like to help with some tests. I saw that the root.go is still without test so I'll take a look at it whenever I have time and try to write some. I'll need to get familiar with the functionallity first, but hopefully it won't take long..

from caddy.

mholt avatar mholt commented on June 3, 2024

@Makpoc We'd totally welcome your help :) Feel free to join us in Slack if you have any questions!

from caddy.

mholt avatar mholt commented on June 3, 2024

I'm closing this since we have tests in every package now and have vastly improved from having no tests at all. Thanks to all who have got us this far.

Tests will always be changing and needing improvements and more thorough coverage, so if you see this issue later, please don't hesitate to jump in to help with tests. Even though the issue is closed, we are always working on improving tests and test coverage. Feel free to ask if you want to get some pointers to get started contributing!

from caddy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.