mikeizbicki / cmc-csci046

CMC's Data Structures and Algorithms Course Materials
52 stars 152 forks source link

Merge Error in BST Test case? #513

Closed luisgomez214 closed 1 year ago

luisgomez214 commented 1 year ago

Hello,

When I run my code for 'test__BST_eq' I get an error message. I noticed that my test case is different than the one on Mike's AVL Branch. I figured that it may be a merge error. When I edit the test case to correctly match what Mike has, my code passes. Meaning that my code does work. Would the best option be to start the branch process from the beginning? I know we are not allowed to edit the test cases. Also, I am not sure how the merge error occurred because during lab time last week, no merge conflict appeared when I was making my branch. Thank you.

Code in my original test case:

assert bst1 == bst2

Code in Mikes test case:

` xs = list(set(xs))

xs1 = copy.copy(xs)
random.shuffle(xs1)
bst1 = BST(xs1)

xs2 = copy.copy(xs)
random.shuffle(xs2)
bst2 = BST(xs2)

assert bst1 == bst2`

As shown, I only had the last line of what Mike had.

finnless commented 1 year ago

You should be able to run git checkout upstream/avltree tests/test_BST.py

More info in this SO thread.

luisgomez214 commented 1 year ago

When I try the command, I get the same test case my original. I am not sure why it is not updating to what Mike has.

mikeizbicki commented 1 year ago

The command that @finnless mentioned will only work if you have already run the

$ git fetch upstream avltree

command. In general, I prefer git pull because it combines the fetch and merge into a single command.

@luisgomez214 I don't want this git problem to prevent you from submitting. Go ahead and edit the test case manually to match what it should. This shouldn't result in git errors further on.

Alternatively, I'm fine if we resolve the git problems during office hours next week, and I'll consider today to be your submission day for the purposes of grading.

finnless commented 1 year ago

Make sure you have no unstaged changes when running this. Make sure your upstream/avltree remote is set up correctly. You can do this by running git checkout upstream/avltree and looking at the test_AVLTree.py file.

luisgomez214 commented 1 year ago

I went ahead and updated my test case and my badge is green for BST. However, my AVLTree is badge still showing red even though my tests all pass in the terminal. I am getting this message in the "Actions".

Run actions/setup-python@v2 [5](https://github.com/luisgomez214/containers/actions/runs/4560083253/jobs/8044692728#step:3:6) Version 3.6 was not found in the local cache [6](https://github.com/luisgomez214/containers/actions/runs/4560083253/jobs/8044692728#step:3:7) Error: Version 3.6 with arch x64 not found [7](https://github.com/luisgomez214/containers/actions/runs/4560083253/jobs/8044692728#step:3:8) The list of all available versions can be found here: https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json

I came to the QCL but neither I nor the tutors were able to figure it out. Is it possible to discuss this issue during office hours? I went ahead and submitted my assignment to show that I have not changed any code. Thank you.

mikeizbicki commented 1 year ago

@luisgomez214 This issue would be fixed when running the git pull command. We'll review the details when we meet in person.