Skip to content

Deterministic testing #42

@bdelespierre

Description

@bdelespierre

AlgorithmTest::clusterize fails randomly because it uses randomized data.

PHPUnit 9.5.19 #StandWithUkraine

Runtime:       PHP 8.1.1 with Xdebug 3.1.2
Configuration: /home/benjamin/Workspace/bdelespierre/php-kmeans/phpunit.xml.dist

..................................F

Time: 00:00.167, Memory: 10.00 MB

There was 1 failure:

1) Tests\Unit\Euclidean\AlgorithmTest::testClusterize with data set "3D" (Kmeans\Euclidean\Space Object (...), 2.0, Kmeans\PointCollection Object (...), Kmeans\PointCollection Object (...), Kmeans\PointCollection Object (...))
Failed asserting that 2.096814878707058 is less than 2.0.

/home/benjamin/Workspace/bdelespierre/php-kmeans/tests/Unit/AlgorithmTest.php:87

FAILURES!
Tests: 35, Assertions: 69, Failures: 1.

Generating code coverage report in Clover XML format ... done [00:00.006]

Generating code coverage report in HTML format ... done [00:00.043]

This issue must be solved by effectively removing the randomization part and replacing every dataset by static ones.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions