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

Fix multiple test upload failing #92

Merged
merged 3 commits into from
May 17, 2023
Merged

Conversation

natsukagami
Copy link
Owner

@natsukagami natsukagami commented May 17, 2023

Fixes #86. Depends on #91.

  • Change how multiple tests are inserted
  • Add tests for multiple tests upload

Read each of them one by one, insert them one by one.
Seems slower, but we avoid having all the tests in memory.
@natsukagami natsukagami force-pushed the fix-multiple-test-upload-86 branch from c0177b1 to 9e83525 Compare May 17, 2023 18:58
@natsukagami natsukagami marked this pull request as ready for review May 17, 2023 18:59
@natsukagami natsukagami force-pushed the fix-multiple-test-upload-86 branch from 44e8039 to e9a16f1 Compare May 17, 2023 19:32
Comment on lines +268 to +276
if _, err := db.Exec(
"INSERT INTO tests(name, test_group_id, input, output) VALUES (?, ?, ?, ?)",
test.Name,
test.TestGroupID,
input,
output,
); err != nil {
return errors.Wrapf(err, "inserting test `%s`", test.Name)
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for future me: We upload tests one-by-one so that we don't have to store all the tests' content in memory at once. This helps with big test-sets that adds up to gigabytes of text.

@natsukagami natsukagami added this to the v0.7.5 "Maaya Awatsuki" milestone May 17, 2023
@natsukagami natsukagami merged commit c4925a0 into master May 17, 2023
@natsukagami natsukagami deleted the fix-multiple-test-upload-86 branch May 17, 2023 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test.Verify fails when uploading multiple tests
1 participant