GithubHelp home page GithubHelp logo

Comments (5)

eandre avatar eandre commented on May 24, 2024

I believe real issue is not that there were no tests, but that there were no Go packages:

$ mkdir foo && cd foo && go mod init example.com

$ go test ./...
go: warning: "./..." matched no packages
no packages to test

$ echo $?
1

Whereas if you have a package:

$ echo "package foo" > foo.go

$ go test ./...
?   	example.com	[no test files]

$ echo $?
0

I'm not sure why Go made the distinction to treat "no matching packages" as a test failure; I guess to avoid mistakes. I believe if you have a matching Go package without tests Encore won't treat the tests as failing.

All that said, maybe Encore should treat this scenario as failing the build, and not just the tests? The "One or more tests failed" error is certainly confusing.

from encore.

MatthewJamesBoyle avatar MatthewJamesBoyle commented on May 24, 2024

hmm I did have a go package though:
image .

However if I delete the test file now and re-run the build it does pass. Let me try and repro on a new project. Maybe I did something else wrong.

from encore.

MatthewJamesBoyle avatar MatthewJamesBoyle commented on May 24, 2024

Ok I reproed this.

  • I ran encore create app
  • I created a project called "testing-no-tests"
  • I selected blank project.
  • I created a package as follows:
image image

from encore.

eandre avatar eandre commented on May 24, 2024

But did you actually commit the thing/thing.go file? I believe the error you're seeing only happens when there are no Go packages.

from encore.

MatthewJamesBoyle avatar MatthewJamesBoyle commented on May 24, 2024

Aha I'm not sure I did :) will close!

from encore.

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.