Giter Club home page Giter Club logo

Comments (5)

onsi avatar onsi commented on May 18, 2024

I just tried this on my laptop with a simple example and it worked. Can you
point me to a code example that's failing for you?

Onsi

On Tuesday, February 4, 2014, Tim Jarratt [email protected] wrote:

I was very surprised to discover that Ginkgo will only run the tests that
are defined in the same package as the suite_test. Seems like a bug, but I
would also accept that this is a feature (because it forces you to write
your tests in the name_test package.

Alternatively, if this is hard to solve, a warning would be very nice.

Reply to this email directly or view it on GitHubhttps://github.com//issues/31
.

from ginkgo.

tjarratt avatar tjarratt commented on May 18, 2024

I took a closer look and the behavior was a little surprising. It appears to work for some cases, but not others.

cloudfoundry/cli@c197cd5 seems to exhibit this behavior for domain_test.go in the cf package

from ginkgo.

onsi avatar onsi commented on May 18, 2024

Methinks this is because the only file in the cf_test package is cf_suite_test.go itself and cf_suite_test.go does not reference any of the cf package files at all.

A simple fix for this might be to add

import (
    . "github.com/onsi/ginkgo"
    . "github.com/onsi/gomega"
        _ "cf"
    "testing"
)

to the cf_suite_test.go file (this could be made the default in the ginkgo bootstrap command, we'd also need to add it to ginkgo convert). This would import the cf package purely for its side effects (in this case, the side effects involve registering the ginkgo tests in that package!)

from ginkgo.

tjarratt avatar tjarratt commented on May 18, 2024

I wasn't aware you could import a package as _. That's ... interesting.

With that information, this doesn't sound like a real bug per se. It's already conventional to put your tests in a separate package from your package under test, so I would be willing to chalk this up to user error and consider this issue closed.

from ginkgo.

onsi avatar onsi commented on May 18, 2024

Coo :)

Yeah... _ is interesting.............

On Feb 6, 2014, at 9:47 PM, Tim Jarratt [email protected] wrote:

I wasn't aware you could import a package as _. That's ... interesting.

With that information, this doesn't sound like a real bug per se. It's already conventional to put your tests in a separate package from your package under test, so I would be willing to chalk this up to user error and consider this issue closed.


Reply to this email directly or view it on GitHub.

from ginkgo.

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.