Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Suite #777

Open
JoshData opened this issue Mar 31, 2016 · 16 comments
Open

Test Suite #777

JoshData opened this issue Mar 31, 2016 · 16 comments

Comments

@JoshData
Copy link
Member

We need tests. The tests should verify that every configuration change made by the Mail-in-a-Box setup, and any installed configuration files, are having the intended effect. For instance, SMTP TLS settings should be tested by an SMTP client that verifies that the TLS connection has the correct properties.

I could really use everyone's help here figuring out how to get a comprehensive test suite working. There are probably a few hundred things that need to have a test written.

@yodax
Copy link
Contributor

yodax commented Mar 31, 2016

Would you like to embed that in the status_checks? So normal status checks would be as is, but you could also run a diagnostics suite that would run all the tests? If we do it that way we can use it to debug issues on deployments.

@JoshData
Copy link
Member Author

No, this should be separate. This is a tool for development, to make sure we are doing the right thing, not to check if the user has installed a box correctly.

@yodax
Copy link
Contributor

yodax commented Mar 31, 2016

Perhaps something like behave a python version of the cucumber language. That way we would be writing documentation and tests.

I have used SpecFlow (C# Cucumber port) before and find it a good tool to describe the desired situation clearly and easy to integrate into the back-end to run the actual test.

@TabTwo
Copy link
Contributor

TabTwo commented Apr 5, 2016

You wrote about testing tls, dns, smtp ....
Could we use something like Icinga/Nagios for this?
Like, if the external monitoring says everything is all right, then the miab V0.18 passes this unit-test.

So, we would need a ded. host/Vagrant box + provisioning + config of the monitoringsystem + a domain to test.

@JoshData
Copy link
Member Author

JoshData commented Apr 5, 2016

I don't think any particular test framework is going to be very helpful. There are too many different sorts of things that need testing.

@TabTwo
Copy link
Contributor

TabTwo commented Apr 6, 2016

do you already have a list of things that need to be tested?

@JoshData
Copy link
Member Author

JoshData commented Apr 6, 2016

No, and making that list seems like the first thing that needs to be done.

@TabTwo
Copy link
Contributor

TabTwo commented Apr 12, 2016

could you create a new repository "testsuite" (or whatever you prefer) so we can fork + collect ideas?

@JoshData
Copy link
Member Author

You got it: https://github.com/mail-in-a-box/mailinabox-testsuite. I also made you an admin of the new repo. :)

@wsteitz
Copy link
Contributor

wsteitz commented Nov 17, 2016

do you want to enhance what is in the tests folder or create something completely new?

sovereign has a test suite that runs against a vagrant machine (https://github.com/sovereign/sovereign/blob/master/tests.py), I could imagine doing something similar for miab.

@JoshData
Copy link
Member Author

Either way.

@JoshData JoshData mentioned this issue Dec 4, 2016
wsteitz added a commit to wsteitz/mailinabox that referenced this issue Dec 11, 2016
wsteitz added a commit to wsteitz/mailinabox that referenced this issue Dec 20, 2016
wsteitz added a commit to wsteitz/mailinabox that referenced this issue Jan 22, 2017
wsteitz added a commit to wsteitz/mailinabox that referenced this issue Feb 2, 2017
yeah pushed a commit to yeah/mailinabox that referenced this issue Feb 4, 2018
@brycefisher
Copy link

I realize this is an old thread, but it still seems relevant. To summarize what I'm seeing as the state of things:

  • There is a desire from @JoshData to have tests in this project
  • While there is a body of tests (in this repo in the "tests/" directory), there's no continuous integration system (or at least none integrated into this Github repo)
  • There's a desire to eventually do in-depth functional testing of, for example, dovecot configurations, etc, etc

I think those are fantastic goals, but perhaps quite lofty. I propose we setup continuous integration to setup unit tests for the various bits of python so that any PR submitted to the project gets at least some minimal amount of automated testing done. Hopefully, this would reduce of some of the burden on @JoshData. I would start very small, with perhaps only 1 or 2 simple tests that can run consistently, and slowly working on building out a bigger test suite.

I think this is a small enough task someone could contribute a minimal py.test unit testing PR and walk JoshData through the necessary steps of integrating a free-for-open-source cloud CI.

Before diving into the details around what testing framework, what CI, and what specifically to test, does this sound like a good idea to you @JoshData? Would you be willing to accept a well-written PR to this repository that setup minimal, continuous testing?

@JoshData
Copy link
Member Author

Thanks for reviving this old issue. It's an important one.

There's always an allure of setting up a new tool like CI but not doing the less interesting work of building the tests (and the CI part is the largest time-draw for me), so I'd like to see some more useful tests in place before we do CI for the existing tests.

Crucially, we're missing tests for installing the box from scratch and performing upgrades. We have a Vagrant file but nothing around it.

@brycefisher
Copy link

brycefisher commented Feb 15, 2021 via email

@JoshData
Copy link
Member Author

I agree with incrementalism, but if the CI system can't install the box from scratch, it's not really testing anything --- it's just sending me emails about things that don't matter.

@brycefisher
Copy link

brycefisher commented Feb 15, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants