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

Updating tests for poker exercise #2878

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jagdish-15
Copy link
Contributor

@jagdish-15 jagdish-15 commented Dec 11, 2024

Pull Request

This PR updates all 11 unsynced tests for the Poker exercise, including 2 reimplemented tests and newly added tests to align with the problem-specifications repository.


Reviewer Resources:

Track Policies

@kahgoh
Copy link
Member

kahgoh commented Dec 11, 2024

The poker tests in the CI is failing. Does the example solution need updating?

Checking poker exercise...
poker: example solution did not pass the tests

@jagdish-15
Copy link
Contributor Author

The poker tests in the CI is failing. Does the example solution need updating?

I've updated the Poker.java file and its helper classes to ensure they pass the tests. However, I'm still unsure how to verify the changes locally using configlet. Could you guide me on that?

@kahgoh
Copy link
Member

kahgoh commented Dec 13, 2024

Unfortunaetly, the tests and Checkstyle tests are still failing. To run the tests locally, run ./gradlew test from the exercises directory. For example:

# Start from where you clone the repo to
cd exercises
./gradlew test

If you want to run just the poker test, use ./gradlew practice:poker:test. I also recommend running ./gradlew check to run Checkstyle.

@jagdish-15
Copy link
Contributor Author

Thank you so much, @kahgoh, for this! I truly appreciate your guidance—I wasn’t aware we could run these tests locally, and this has been incredibly helpful.

After testing the old reference answers on my local machine, I discovered that the initial reference implementation was failing five tests. Despite spending over two hours trying to understand the code, I found it overly complex and challenging to follow. A few days later, I attempted to use AI for assistance, but unfortunately, that approach also fell short.

Eventually, I realized I could explore community solutions for inspiration. While I didn’t immediately find a fully working solution, analyzing the approaches helped me iterate and improve. During this process, I identified several excellent alternatives that were far more efficient and readable compared to the original implementation. However, these solutions all failed a newly added test case.

This led me to uncover an oversight on my part—I had mistakenly marked the test as passed in the initial implementation. I sincerely apologize for this error. That said, since the original code was already failing four other tests, replacing it was necessary.

After further investigation, I selected the best community solution available, which resolved most issues. I also located the GitHub profile of the original contributor and have appropriately credited them as a contributor to the project.

[All tests have now been passed.]

Please let me know if you have any thoughts or feedback on this update!

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.

2 participants