#Running ballerina tests with a empty test.bal file

1 messages · Page 1 of 1 (latest)

primal tundra
#

When I run bal test throwing error

Compiling source
        nimsara/test:0.1.0

Running Tests

        test
error: failed to load test execution class :nimsara.test$test.0.
error: there are test failures

The error indicating there are test failures but there are no tests. Is this behaviour desired?

Steps to reproduce:

  1. Create a sample ballerina project
  2. Add tests sub-directory to project
  3. Add a empty ballerina file in tests/
  4. run bal test
#

Another case

Suppose I have a single test file

import ballerina/io;
import ballerina/test;

// Before Suite Function

@test:BeforeSuite
function beforeSuiteFunc() {
    io:println("I'm the before suite function!");
}

// After Suite Function

@test:AfterSuite
function afterSuiteFunc() {
    io:println("I'm the after suite function!");
}

now when I run bal test I get

Compiling source
        nimsara/test:0.1.0

Running Tests

        test
        No tests found

which is okay.

But when I run bal test --code-coverage
I get error

Compiling source
        nimsara/test:0.1.0

Running Tests with Coverage

        test
        No tests found
error: error occurred while running testsjava.nio.file.NoSuchFileException: /Users/nimsara/Desktop/test/target/cache/tests_cache/test/module_status.json

Is this also the desired behaviour?

floral dome
#

Looping in @clear dew

These seem to be exceptions rather than the intended behaviour. Both scenarios work as expected for me with Ballerina 2201.6.0 on Ubuntu.

Running Tests

        test_proj
        No tests found

Can you please share details including the Ballerina version?

primal tundra
#

Ballerina 2201.5.0
I have tested on my mac as well as on ubuntu latest using [email protected]