Giter Site home page Giter Site logo

Comments (6)

pmjones avatar pmjones commented on June 15, 2024

Nice. I wonder if we should create the new phpunit* files in addition to the existing ones, so the existing ones can still be run separately. Or maybe the container phpunit* files, being an integration, should be moved up to tests/ and run from there, to include the actual unit tests. Then test-runners can get the full gamut of tests.

Thanks for working on this @Beanow, please comment more as you continue working.

from aura.router.

Beanow avatar Beanow commented on June 15, 2024

The idea for moving the tests up one level was primarily so we only need one copy of all the vendor packages. If we can build the existing tests to use the same vendor folder we can have the best of both.

Another option is to have variations only on the phpunit.xml files and set them specifically as a phpunit parameter.

I do think that for TDD it makes sense to always run both tests, checking for unexpected side-effects is precisely one of the great benefits of automated tests in my experience. I'll have a look none the less.

from aura.router.

Beanow avatar Beanow commented on June 15, 2024

I've implemented the multiple phpunit.xml variation and made a more flexible phpunit.sh script accepting several commonly used options.

$ tests/phpunit.sh -h
Usage: phpunit.sh [-hcdsp] [SUITE]...
Run the PHPUnit tests defined by the given suite.
By default the suite is '.', which runs all suites.

    -h              Display this help and exit.
    -d              Deploy the vendor package using composer.
    -s              Supress PHPUnit status code, always returning 0.
    -p              Preparations only, this skips the actual testing.
                    Useful for doing a one-time deployment with -d for example.
    -c type[=path]  Generate code coverage reports.
                    Type indicated the type of reports, based on phpunit functionality.
                    The optional path indicates where to store the report.

Examples scenarios:

  phpunit.sh -dc html=coverage.html
    Deploy the vendor package and generate a code coverage report in HTML format.

  phpunit.sh -c text unit
    Run the unit test suite only and report code coverage in TEXT format.

  phpunit.sh -dp
    Deploy vendor package only and skip testing.

My library now has 3 test suites you could run.

  • . which maps to tests/phpunit.xml which runs both the unit and container tests.
  • unit which maps to tests/unit/phpunit.xml.
  • container which maps to tests/container/phpunit.xml.

Please note your current working directory when running the script matters.
You should always cd tests before executing. As in the .travis.yml file.

from aura.router.

Beanow avatar Beanow commented on June 15, 2024

This script is working well for us. Feel free to help yourself to a copy.
Perhaps you may decide to remove edge cases like the status code suppression.

from aura.router.

harikt avatar harikt commented on June 15, 2024

@Beanow please see #72 . Feedback welcome :) . Discussion over google group https://groups.google.com/d/msg/auraphp/Dcxoigi13ss/HEjP3iJ_Wc8J

from aura.router.

pmjones avatar pmjones commented on June 15, 2024

For the record I have not forgotten this. I am working on a revised testing structure that, while it is not exactly what I like best, will cover this and perhaps other cases. Thanks for your continued patience.

from aura.router.

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.