Coder Social home page Coder Social logo

Comments (4)

kkourt avatar kkourt commented on August 12, 2024 2

Maybe something like the following:

for pkg in $(go list ./...)
do
   localpkg=$(echo $pkg | sed -e 's:github.com/cilium/tetragon/::')
   localtestfile=$(echo $localpkg | sed -e 's:/:.:g')
   echo go test -c ./$localpkg -o go-tests/$localtestfile
done

from tetragon.

willfindlay avatar willfindlay commented on August 12, 2024

Are these all or only some? We should build all test binaries like this in a step other than make test (that one would run with sudo), maybe just in make itself or one of its dependencies.

Right, it's non-exhaustive at the moment. I think the "right" way to do this would probably be with a glob in the Makefile that compiles all tests (rather than hard-coding each one which, as you've pointed out is very error-prone as new tests are added). Then we would have another target as you suggest that would run each test (also using a glob).

A PR would be much appreciated!

from tetragon.

kkourt avatar kkourt commented on August 12, 2024

We should build the test binaries with go test -c in a make step that doesn't require 'sudo', and then only run those test binaries with sudo.

That would be great!
We can even support both options and keep the one above for the people that want it.

Are these all or only some? We should build all test binaries like this in a step other than make test (that one would run with sudo), maybe just in make itself or one of its dependencies.

I don't think that's all. I think a better approach would be to use go list ./... to get all the packages, and then (somehow) build the proper binaries.

from tetragon.

kkourt avatar kkourt commented on August 12, 2024

Above ☝🏼 exists now (test-compile target), so closing this.

from tetragon.

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.