bleep icon indicating copy to clipboard operation
bleep copied to clipboard

`bleep test --only` often doesn't find the test

Open nafg opened this issue 4 months ago • 3 comments

I don't know how to deterministically reproduce this, but often after changing a test if I run it with bleep test --only it says the test is not found. Simply running the command again a few times, or running a bleep compile, often helps.

nafg avatar Aug 05 '25 17:08 nafg

I have seen this as well, but only when creating a new test suite, never for a single test. I think there is some ordering issue going on where compile isn't run before test so that test doesn't actually see there is a new test-suite.

I will try to reproduce and fix the case for entire suites, hopefully this would also fix the issue you are experiencing.

KristianAN avatar Aug 07 '25 10:08 KristianAN

if i remember correctly this functionality looks at the previously compiled class files, doesnt it? this is rather beneficial, because it would mean we can build effective tab-completion for cli for test names. but it means that if compilation is outdated then --only can see old information? we should look into this somewhat and see if its something obvious to improve.

oyvindberg avatar Aug 08 '25 10:08 oyvindberg

I've been getting it very often for tests that are not new. Often just running the command a few times gets it to work. Running compile first makes it more likely to work but it still sometimes claims it doesn't exist. So I don't think this is about whether to compile first. There's just some non-deterministic behavior somehow.

In any case I don't think tab completion performance should be the consideration. No one would find it surprising if a test name works even if tab completion didn't show it. But in the Scala world we do find it surprising if our build tools require us to run a series of manual steps. If you don't pass a project name it could use the cache to determine what project has the test, but it certainly should compile the needed project(s) before deciding the test doesn't exist.

So IMO:

  • bleep test -o X y: compile y in any case
  • bleep test -o X: if we know X is in y, compile y. If we don't know where X is, compile everything.

But again, I don't think my issue has to do with that.

P.S. wouldn't bleep test y -o X be a more intuitive order?

Also I want to be able to pass arguments to the test runner like -t specificTest. I was able to drop down to bloop for that though.

nafg avatar Aug 08 '25 15:08 nafg