Giter VIP home page Giter VIP logo

Comments (9)

Narven avatar Narven commented on June 22, 2024 1

I think this needs to change from this:

export function runBuilder(options: BuildBuilderSchema, context: BuilderContext): Observable<BuilderOutput> {
  return from(context.getProjectMetadata(context?.target?.project)).pipe(
    map((project) => {
      const root = project.root
      const sources = `-v ${root}/**/*.go`

      return runGoCommand(context, 'test', [sources])
    }),
  )
}

to this:

export function runBuilder(options: BuildBuilderSchema, context: BuilderContext): Observable<BuilderOutput> {
  return from(context.getProjectMetadata(context?.target?.project)).pipe(
    map((project) => {
       const sources = `./... -v`; // also could include -race by default
        return runGoCommand(context, 'test', [sources], { cwd: project.root});
    }),
  )
}

from nx-go.

Narven avatar Narven commented on June 22, 2024 1

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"
}

from nx-go.

beeman avatar beeman commented on June 22, 2024 1

@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!

from nx-go.

Narven avatar Narven commented on June 22, 2024

The best approach it think, it would be to allow any extra arg be passed, that would allowd to had for example -race or -cover

from nx-go.

Narven avatar Narven commented on June 22, 2024

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

from nx-go.

Narven avatar Narven commented on June 22, 2024

@beeman I do not have permissions to push a new branch

from nx-go.

fallion avatar fallion commented on June 22, 2024

@Narven you can create a Pr by forking this repo and creating a branch on your fork. Then you should be able to open a PR here.

from nx-go.

beeman avatar beeman commented on June 22, 2024

This is now fixed in version 1.3.0

from nx-go.

beeman avatar beeman commented on June 22, 2024

The best approach it think, it would be to allow any extra arg be passed, that would allowd to had for example -race or -cover

Thanks for the suggestion! These are available and enabled by default in 1.4.0.

from nx-go.

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.