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

Update dolt to v1.15.0 in unit_tests #22

Merged
merged 9 commits into from
Sep 19, 2023
Merged

Conversation

tommasogritti
Copy link

@tommasogritti tommasogritti commented Sep 14, 2023

It started as a simple issue to update to the most recent version of dolt and ended up taking quite a while to fix all the tests and some code logic.

@tommasogritti tommasogritti linked an issue Sep 14, 2023 that may be closed by this pull request
@tommasogritti tommasogritti marked this pull request as ready for review September 14, 2023 08:59
@tommasogritti tommasogritti marked this pull request as draft September 14, 2023 09:06
@tommasogritti tommasogritti marked this pull request as ready for review September 15, 2023 13:17
Wrong parsing of merge output was causing test_merge_fast_forward to
fail
This will be removed once issue with dolt table import -u is fixed
dolthub/dolt#6675
Improve merge docstring
This fixes test_dolt_log_merge_commit test as now merge message is
correctly used
This code was never reach as --commit flag was always set by default
in dolt merge command
Test is fixed thanks to adding -m flag to merge command
Copy link

@alessiamarcolini alessiamarcolini left a comment

Choose a reason for hiding this comment

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

shall we mention in the readme the version of dolt? right now a user needs to check the github actions

@tommasogritti tommasogritti merged commit 9a49d4b into main Sep 19, 2023
11 checks passed
@tommasogritti tommasogritti deleted the 21-bump-dolt-to-v1150 branch September 19, 2023 18:11
@@ -184,7 +184,10 @@ def writer(filepath: str):
for row in rows:
fieldnames = fieldnames.union(set(row.keys()))

csv_writer = csv.DictWriter(f, fieldnames)
# TODO: this is only needed to make sure test_update_rows passes until an issue
Copy link
Author

Choose a reason for hiding this comment

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

Let's see if/how quickly dolt resolves the dolt table import -u function.
Until then this fix is needed albeit not necessary in the future.

if len(output) == 5 and output[merge_conflict_pos].startswith("CONFLICT"):
# TODO: this was and remains a hack, we need to parse the output properly
merge_conflict_pos = 8
if len(output) > 1 and output[merge_conflict_pos].startswith("CONFLICT"):
Copy link
Author

Choose a reason for hiding this comment

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

The existing version, coming directly from the original doltcli from dolt, was equally hacky.
You can see by searching in the dolt codebase for "CONFLICT (" that the output of the merge command is not immediately clear.

Examples of outputs I could generate are as follows.
For fast forward:

['Fast-forward', 'Updating 41sae35r40u...mkfb6701os', '\x1b[33mcommit 41sae35r...[33m) \x1b[0m', 'Author: tommasogritt...gmail.com>', 'Date:  Fri Sep 15 15...+0200 2023', '', '\tOther branch', '', 'test_players | 1 +', '1 tables changed, 1 ...deleted(-)', '']

For conflict:

['Updating rnqbuq47gb4...v73thsjb0u', '\x1b[33mcommit rnqbuq47...[33m) \x1b[0m', 'Author: tommasogritt...gmail.com>', 'Date:  Fri Sep 15 15...+0200 2023', '', '\tadded Micheal id 5', '', 'Auto-merging test_players', 'CONFLICT (content): ...st_players', 'Automatic merge fail... unmerged.', "Use 'dolt conflicts...conflicts.', '']

For automatic merging with merge message set to "this_is_my_merge_message"

['Updating fno7svcm2h9...3jfcics6og', '\x1b[33mcommit fno7svcm...[33m) \x1b[0m', 'Merge: sakvecfg1201s...3jfcics6og', 'Author: tommasogritt...gmail.com>', 'Date:  Fri Sep 15 15...+0200 2023', '', '\tthis_is_my_merge_message', '', 'test_players | 1 +', '1 tables changed, 1 ...deleted(-)', '']

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.

Bump dolt to v1.15.0
3 participants