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

Add a check for missing test files and raise a more helpful error #468

Merged
merged 26 commits into from
Apr 28, 2022

Conversation

ALCooper12
Copy link
Contributor

@ALCooper12 ALCooper12 commented Apr 6, 2022

🤔 What's changed?

  • Added a check for missing test files and raised a more helpful error

Fixes #383.

⚡️ What's your motivation?

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

ALCooper12 and others added 23 commits November 10, 2021 11:48
Co-authored-by: Matt Wynne <[email protected]>
@mattwynne
Copy link
Member

mattwynne commented Apr 20, 2022

@vearutop I am a bit stuck on how to advise @ALCooper12 to actually fix this. We've got it trapped with a failing test around Builder.Build as you suggested in Slack a few weeks ago.

It appears that the unexpected error we're seeing is because the compilerCfg file (importcfg.link) is missing from the build directory. The code beneath here assumes that there will be a file at compilerCfg but in fact that file is only copied if we go into the if statement here.

I don't really understand how we end up in this situation just because the user has called their file main.go instead of main_test.go!?

Can you shed any light on it?

ALCooper12 and others added 2 commits April 20, 2022 12:03
we examined the output from running `go test` which tells us if we didn't
find any test files.
we tweaked the error message to follow the capitalization rules

Co-authored-by: Matt Wynne <[email protected]>
@ALCooper12 ALCooper12 marked this pull request as ready for review April 20, 2022 19:11
@mattwynne mattwynne requested a review from vearutop April 20, 2022 19:12
@ALCooper12
Copy link
Contributor Author

I still need to update the change log, but otherwise this is ready!
Please be gentle with feedback lolz

@ALCooper12 ALCooper12 closed this Apr 20, 2022
@ALCooper12 ALCooper12 reopened this Apr 20, 2022
@codecov
Copy link

codecov bot commented Apr 20, 2022

Codecov Report

Merging #468 (5468a92) into main (237a855) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #468      +/-   ##
==========================================
+ Coverage   81.41%   81.42%   +0.01%     
==========================================
  Files          27       27              
  Lines        2195     2197       +2     
==========================================
+ Hits         1787     1789       +2     
  Misses        312      312              
  Partials       96       96              
Impacted Files Coverage Δ
internal/builder/builder.go 55.02% <100.00%> (+0.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 237a855...5468a92. Read the comment docs.

@mattwynne
Copy link
Member

@vearutop any feedback?

Copy link
Member

@vearutop vearutop left a comment

Choose a reason for hiding this comment

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

I have a minor suggestion, overall this looks good to me! 👍

@vearutop vearutop merged commit 1a795f1 into cucumber:main Apr 28, 2022
@aslakhellesoy
Copy link
Contributor

Hi @ALCooper12,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

@mattwynne
Copy link
Member

🎉 congrats @ALCooper12 and thanks for all your hard work and patience figuring out this fix together. I've learned a lot about Go and godog's codebase working with you, I hope we can continue working together!

@vearutop vearutop changed the title Fix issue#383 Add a check for missing test files and raise a more helpful error Jan 5, 2023
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.

Incorrect project structure gives an unhelpful error message
4 participants