This repository was archived by the owner on Jun 4, 2024. It is now read-only.
This repository was archived by the owner on Jun 4, 2024. It is now read-only.
A test passes locally fails in Github action CI or vice versa #137
Closed
Description
Test: tests\unit\MultiDbSecondaryMigrationTest::testMysql
Github action fail: https://github.com/SOHELAHMED7/yii2-openapi/actions/runs/4253815431/jobs/7399197040
Locally
There was 1 failure:
1) tests\unit\MultiDbSecondaryMigrationTest::testMysql
Failed asserting that file contents of
/app/tests/tmp/docker_app/migrations_mysql_db/m200000_000005_change_table_v2_comments.php
are equal to file contents of
/app/tests/specs/blog_v2/migrations_mysql_db/m200000_000005_change_table_v2_comments.php
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
+ $this->dropForeignKey('fk_v2_comments_post_id_v2_posts_uid', '{{%v2_comments}}');\n
$this->dropForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}');\n
- $this->dropForeignKey('fk_v2_comments_post_id_v2_posts_uid', '{{%v2_comments}}');\n
@@ @@
+ $this->addForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}', 'id', 'v2_users', 'author_id');\n
$this->addForeignKey('fk_v2_comments_post_id_v2_posts_uid', '{{%v2_comments}}', 'uid', 'v2_posts', 'post_id');\n
- $this->addForeignKey('fk_v2_comments_author_id_v2_users_id', '{{%v2_comments}}', 'id', 'v2_users', 'author_id');\n
/app/tests/unit/MultiDbSecondaryMigrationTest.php:109
/app/tests/unit/MultiDbSecondaryMigrationTest.php:67
phpvfscomposer:///app/vendor/phpunit/phpunit/phpunit:52
FAILURES!
Tests: 1, Assertions: 33, Failures: 1.
If I fix locally by copying content of /app/tests/tmp/docker_app/migrations_mysql_db/m200000_000005_change_table_v2_comments.php
to /app/tests/specs/blog_v2/migrations_mysql_db/m200000_000005_change_table_v2_comments.php
then this test fails on Github actions.
If I fix this test as per Github action, then Github CI passes but this tests fails locally.
Metadata
Metadata
Assignees
Labels
No labels