question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Go test only checks main_test.go

See original GitHub issue

https://github.com/nx-go/nx-go/blob/d6fe9430be4a11a1a5a4cce417d7f97efb7e881a/packages/nx-go/src/builders/test/builder.ts#L11

Uses go test /apps/name/**/*.go However this seems to only check the main_test.go. Perhaps apps/name/... might work better.

I can help if needed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
beemancommented, Jan 29, 2021

@beeman let me know if you want me to PR on this

Hey @Narven - I would really appreciate a PR! I should have some time this weekend en next weekend to look at nx-go!

I’m about to start a pet project that uses Go so I’ll be using this again!

1reaction
Narvencommented, Jan 29, 2021

Also forgot about this, in the workspace.json it the builder needs to change from:

"test": {
  "builder": "@nx-go/nx-go:test",
  "options": {
    "main": "apps/api/main_test.go"
  }
}

to just:

"test": {
  "builder": "@nx-go/nx-go:test"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing in Go: go test - Ilija Eftimov ‍
The go test command ships with Go itself, so if you have Golang installed, there's nothing to check - it's available on your...
Read more >
How to test the main package functions in golang?
Unit tests only go so far. At some point you have to actually run the program. Then you test that it works with...
Read more >
testing - Go Packages
Package testing provides support for automated testing of Go packages. ... A parent test will only complete once all of its subtests complete....
Read more >
Why use TestMain for testing in Go? - Medium
Basically the TestMain function provides more control over running tests than was available in the prior releases of Go. So if the test...
Read more >
Golang Testing: Unit Testing Go Applications - Linode
They are then linked and run with the main test binary. Go's ... Only a high-confidence subset of the default go vet checks...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found