singularity icon indicating copy to clipboard operation
singularity copied to clipboard

-run flag to go test does not work with e2e framework

Open jscook2345 opened this issue 6 years ago • 5 comments

Version of Singularity:

master

  • Edit Makefile to have -run TestHelp -v arguments to go test
[vagrant@localhost singularity]$ SINGULARITY_E2E=1 make -C builddir e2e-test
make: Entering directory `/home/vagrant/singularity/builddir'
 TEST sudo go test [e2e]
testing: warning: no tests to run
PASS
coverage: 0.0% of statements
ok      github.com/sylabs/singularity/e2e       1.008s  coverage: 0.0% of statements [no tests to run]
       PASS
make: Leaving directory `/home/vagrant/singularity/builddir'

Does not work. I also tried using HELP, Help, and help. All resulted in testing: warning: no tests to run.

jscook2345 avatar Apr 22 '19 16:04 jscook2345

If you set the -run flag to TestE2E/HELP/TestHelp you can get the effect, but that's a lot to try and remember when you just want to test a single function

jscook2345 avatar Apr 26 '19 16:04 jscook2345

Hmmm... this one is hard.

The matching is done by code in the testing package. There's some generated code with the list of tests (those func TestFoo) in each of the packages under test. When you say -run or -list, that's the list that the resulting program looks at. Since E2E is written is a peculiar way, there are no other tests than the top level one, everything else is a subtest, and subtests have dynamic names and are therefore not discoverable at build time (when you run go test).

One way to fix this would be to make everything regular Go tests (func TestFoo(t *testing.T)). The problem with this is that E2E has a number of warts, with a significant amount of global state. This can be cleaned up, of course.

mem avatar Sep 06 '19 21:09 mem

Hello,

This is a templated response that is being sent out to all open issues. We are working hard on 'rebuilding' the Singularity community, and a major task on the agenda is finding out what issues are still outstanding.

Please consider the following:

  1. Is this issue a duplicate, or has it been fixed/implemented since being added?
  2. Is the issue still relevant to the current state of Singularity's functionality?
  3. Would you like to continue discussing this issue or feature request?

Thanks, Carter

carterpeel avatar May 15 '21 16:05 carterpeel

This issue has been automatically marked as stale because it has not had activity in over 60 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 14 '21 16:07 stale[bot]

@jscook2345 Still getting this problem ? Have this been solved already ? If yes, what work around have you followed and applied ?

We're looking into the issue carefully, soon will bring to community and discuss ways to better solve as well address this. Thankyou for keeping the interest in the subject.

pedroalvesbatista avatar Jul 15 '21 06:07 pedroalvesbatista

Transferred to the new Apptainer issue list https://github.com/apptainer/apptainer/issues/1154

kmuriki avatar Mar 06 '23 00:03 kmuriki