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

Test code extraction for exercises with separate file for test cases #107

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

Conversation

meoconbatu
Copy link
Contributor

Fixes #80

This commit also supports arbitrary test data variable name when test function includes multiple assignments.

Recreate the PR from @junedev suggestion in #105 (comment)

@meoconbatu meoconbatu requested a review from a team as a code owner September 27, 2023 18:00
@github-actions
Copy link

Hello. Thanks for opening a PR on Exercism. We are currently in a phase of our journey where we have paused community contributions to allow us to take a breather and redesign our community model. You can learn more in this blog post. As such, all issues and PRs in this repository are being automatically closed.

That doesn't mean we're not interested in your ideas, or that if you're stuck on something we don't want to help. The best place to discuss things is with our community on the Exercism Community Forum. You can use this link to copy this into a new topic there.


Note: If this PR has been pre-approved, please link back to this PR on the forum thread and a maintainer or staff member will reopen it.

@github-actions github-actions bot closed this Sep 27, 2023
This commit also support arbitrary test data variable name when test function
includes multiple assignments.
@junedev junedev reopened this Sep 27, 2023
Copy link
Member

@junedev junedev left a comment

Choose a reason for hiding this comment

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

After these changes, the tests for the conditionals testdata exercise don't compile anymore. It would be great if that could be fixed so go run . testrunner/testdata/concept/conditionals outdir works again. This command is mentioned in the readme so it makes sense it works. Having a runnable example (not only a unit test) also helps double checking the output is correct.

Maybe it would be best you work on a copy of the exercise in a folder called separate_cases_file. Then the current conditionals test data could stay as is and for your new folder/exercise we could even add an entry in integration_test.go to make sure the "end2end" output is as expected. (The tests are more like regression/snapshot tests. To set one up, print the "got" result of the test to the console and paste it into a file in the "expected" folder, given it looks correct of course.)

@junedev junedev added x:rep/large Large amount of reputation hacktoberfest-accepted Make this PR count for hacktoberfest labels Oct 6, 2023
@junedev
Copy link
Member

junedev commented Nov 23, 2023

@ErikSchierboom This should be good to go. I will do some more testing but would be good if you can stamp it.

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

Stamped :)

@coveralls
Copy link

coveralls commented Jan 15, 2024

Pull Request Test Coverage Report for Build 6526488725

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 39 of 79 (49.37%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-3.0%) to 62.878%

Changes Missing Coverage Covered Lines Changed/Added Lines %
testrunner/ast.go 38 78 48.72%
Totals Coverage Status
Change from base Build 5829675059: -3.0%
Covered Lines: 437
Relevant Lines: 695

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Make this PR count for hacktoberfest x:rep/large Large amount of reputation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test code extraction for exercises with separate file for test cases
4 participants