Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Unable to view test cases and execute test cases after upgrading #172

Closed
1 task done
snapshotleisure opened this issue Sep 23, 2022 · 6 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@snapshotleisure
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

What is the current behavior?

I am running Testsigma CE in Docker and after upgrading from v2.0.1 to v2.1 I am no longer able to see my test cases. I am also seeing errors in the log for my agent.

Errors are:
2022-09-23 00:43:06 981358AE6F094D7188E9813957868068 ERROR SqlExceptionHelper:logExceptions:142 qtp1586095399-323 Unknown column 'testdevice0_.prerequisite_test_device_result_id' in 'field list'

2022-09-23 00:43:46 EFA106077EF640E4B723D72C3CBAEE12 ERROR SqlExceptionHelper:logExceptions:142 qtp1586095399-462 Unknown column 'testdata0_.passwords' in 'field list'

I can see for V28__test_device.results.sql file has been modified to include a column prerequisite_test_device_result_id, however this change is never reflected in any of the migration script, so it will never get picked up when upgrading.

Also in v17__test_data.sql, the column passwords

What is the expected behavior?

When upgrading between versions of TestSigma, database changes should be picked up as a migration step.

Steps To Reproduce

In docker-compose, run v2.0.1 as the image and upgrade to v2.1

Version

Testsigma Community Edition

@snapshotleisure snapshotleisure added the bug Something isn't working label Sep 23, 2022
@snapshotleisure
Copy link
Author

Running the following manual changes in the database will temporarily fix the issue:

use testsigma_opensource;
ALTER TABLE test_device_results ADD COLUMN prerequisite_test_device_result_id BIGINT(20);

use testsigma_opensource;
ALTER TABLE test_data ADD COLUMN passwords json;

@snapshotleisure
Copy link
Author

Executing dry run also failed, also found additional columns:

use testsigma_opensource;
ALTER TABLE test_devices ADD COLUMN prerequisite_test_devices_id BIGINT(20);

@snapshotleisure
Copy link
Author

use testsigma_opensource;
ALTER TABLE test_devices ADD COLUMN test_lab_type VARCHAR(255);

use testsigma_opensource;
ALTER TABLE test_device_results ADD COLUMN test_lab_type VARCHAR(255);

use testsigma_opensource;
ALTER TABLE test_devices ADD COLUMN workspace_version_id BIGINT(20);

use testsigma_opensource;
ALTER TABLE test_device_results ADD COLUMN workspace_version_id BIGINT(20);

@snapshotleisure
Copy link
Author

Still Failing to execute a dry run

@snapshotleisure snapshotleisure changed the title [Bug]: Database Changes have been made to the bootstrap entries but not created as Migration, so upgrading versions do not pick up the changes [Bug]: Unable to view test cases and execute test cases after upgrading Sep 23, 2022
@tarun-testsigma
Copy link
Contributor

@snapshotleisure Thanks for bringing it to our notice. We will provide an update regarding the fix by 26th September

@snapshotleisure
Copy link
Author

Just for anyone who is having problems, this is the final sql list to resolve the issue, thank you Amit Savyasachi for the assistance.

ALTER TABLE test_devices add COLUMN prerequisite_test_devices_id bigint(20) DEFAULT NULL;

ALTER TABLE test_devices add COLUMN workspace_id bigint(20) DEFAULT NULL;

ALTER TABLE test_device_results add COLUMN prerequisite_test_device_result_id bigint(20) DEFAULT NULL;

ALTER table test_devices add column test_lab_type varchar(255) DEFAULT NULL;

ALTER table test_device_results add column test_lab_type varchar(255) DEFAULT NULL;

ALTER TABLE test_device_results add COLUMN workspace_id bigint(20) DEFAULT NULL;

ALTER table test_device_results add column target_machine bigint(20) DEFAULT NULL;

update test_devices env set workspace_id = (select workspace_version_id from test_plans where env.test_plan_id=id);

update test_device_results env_result set workspace_id = (select workspace_id from test_devices where env_result.test_device_id = id);

update test_devices env set test_lab_type = (select test_lab_type from test_plans where env.test_plan_id=id);

update test_device_results env_result set test_lab_type = (select test_lab_type from test_devices where env_result.test_device_id = id);

update test_device_results env_result set target_machine = (select target_machine from test_devices where env_result.test_device_id = id);

ALTER table test_devices change workspace_id workspace_version_id bigint(20) DEFAULT NULL;

ALTER table test_device_results change workspace_id workspace_version_id bigint(20) DEFAULT NULL;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants