volatiletech / sqlboiler

Generate a Go ORM tailored to your database schema.
BSD 3-Clause "New" or "Revised" License
6.73k stars 544 forks source link

generated models include testX(t *testing.T) functions, but testing package is not imported #315

Closed louis77 closed 6 years ago

louis77 commented 6 years ago

If you're having a generation problem please answer these questions before submitting your issue. Thanks!

What version of SQLBoiler are you using (sqlboiler --version)?

SQLBoiler v3.0.0-rc4

If this happened at generation time what was the full SQLBoiler command you used to generate your models? (if not applicable leave blank)

sqlboiler --no-tests psql same with sqlboiler psql

If this happened at runtime what code produced the issue? (if not applicable leave blank)

What is the output of the command above with the -d flag added to it? (Provided you are comfortable sharing this, it contains a blueprint of your schema)

Please provide a relevant database schema so we can replicate your issue (Provided you are comfortable sharing this)

Further information. What did you do, what did you expect?

i.e.

func testAvailabilities(t *testing.T) {
    t.Parallel()

    query := Availabilities()

    if query.Query == nil {
        t.Error("expected a query, got nothing")
    }
}

All generated models include these test functions even with specifying --not-tests. However, the package testing is not imported so compilation fails.

aarondl commented 6 years ago

This is very likely path handling problems as you're seing in #314. I'm gonna set up a windows test scenario so I can do some normal runs and see what the heck is going on here. Sorry for the lack of testing on the windows platform :( Will report back soon.

aarondl commented 6 years ago

This was due to a partial fix to the original problem. This doesn't seem to be occurring on windows during generation in v3.0.0-rc5.