Go not running some tests

I'm new to Golang and I'm trying to run some tests from a golang app. Tests are running at a docker container with a Golang 1.12.

My problem is that some tests appear to be running correctly, but others do not.

Example:

I have a function that I wanted to fail on purpose.

func TestLol(t *testing.T) {
    assert.EqualValues(t, 1, 2)
    t.Fail()
}

When i execute the docker container with a "docker run ... go test -v ./..." it should run all the tests and for this function on specific it should fail, but what happends is it do not fail, just log a "ok" beside the test.

Then I tried to run only the folder with test file that should fail.

Log:

ok      github.com/eventials/csw-notifications/services 0.016s
2021/09/25 21:08:44 Command finished successfully.
Tests exited with status code: 0
Stopping csw-notifications_db_1     ... done
Stopping csw-notifications_broker_1 ... done
Going to remove csw-notifications_app_run_ed70597b5c20, csw-notifications_db_1, csw-notifications_broker_1
Removing csw-notifications_app_run_ed70597b5c20 ... done
Removing csw-notifications_db_1                 ... done
Removing csw-notifications_broker_1             ... done 

My question is why golang dont output any log with a FAIL message for this file in specific?

I think it's somewhat related to this question, but as it didn't receive any answear I'm reposting it.

Why the tests are not running ? ( Golang ) - goapp test - bug?

EDIT: I'm editting to this question be more clear.



from Recent Questions - Stack Overflow https://ift.tt/3m5a5vQ
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation