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

Move cases_test.go content into <exercise>_test.go #1872

Closed
bitfield opened this issue Oct 17, 2021 · 7 comments
Closed

Move cases_test.go content into <exercise>_test.go #1872

bitfield opened this issue Oct 17, 2021 · 7 comments
Labels
chore Some cleanup/house-keeping needs to be done here. paused Work paused until further notice

Comments

@bitfield
Copy link
Contributor

bitfield commented Oct 17, 2021

Mentors can't see test cases. I assume the student can see the test cases, as it would make life rather difficult for them if they couldn't, but I can't!

For example, I have a student asking:

My solution fails on the second test case, but I have no idea why.

Neither do I, as there's no way of seeing what the cases are. It's usual in Go to define your cases either in the test function itself, or at least in the same source file. Maybe we could do the same?

@andrerfcsantos
Copy link
Member

What is the exercise for which you can't see the test cases?

@junedev
Copy link
Member

junedev commented Oct 17, 2021

@bitfield Moving all the test cases into the usual <exercise>_test.go file was exactly our plan (as discussed here on Slack).

Nevertheless it might be worth opening an issue in exercism/exercism if its really the case that additional editor files don't show up for the mentor. As @andrerfcsantos said, if you give us an example, we can check it was at least configured correctly on our side.

@junedev junedev changed the title Mentors can't see test cases Move cases_test.go content into <exercise>_test.go Oct 18, 2021
@junedev
Copy link
Member

junedev commented Oct 18, 2021

@andrerfcsantos Let's use this issue to track the task of getting rid of the cases_test.go files (I adjusted the issue title accordingly). Originally I thought this is a super easy copy&paste task but now I realized that the go track uses test case generators and those generate the cases_test.go files. That means if we want to move the cases, we need to adjust the generator(s). Do you still think we should go ahead with the plan?

@andrerfcsantos
Copy link
Member

@junedev I think we should. But what do you think it'd be easier for now, adjusting the generators or making the test runner look for the tests in a cases_test.go?

@junedev
Copy link
Member

junedev commented Oct 19, 2021

Adjusting the test runner is probably easier (especially because it only needs to be done once for everything), however that does not solve the issue that bitfield mentioned that it is rather unusual to have separate cases files in Go.

I would say we adjust 1-3 generators and then decide how to proceed depending on how difficult that was.
Changed my mind, let's get good output with the separate cases file first and then we can discuss other steps.

@bitfield
Copy link
Contributor Author

@andrerfcsantos I believe it was "Word Search". The student was having a problem because reflect.DeepEqual wasn't comparing their result equal, even though it was absolutely correct. It turned out that the problem was the exact type definition that the test was expecting—which we couldn't see.

@andrerfcsantos
Copy link
Member

Recently I saw what @bitfield is saying in another exercise - the exercise had cases_test.go well configured on our side, but I was unable to see it in the mentoring session.

My suspicion is that students where this is happening started the exercise before our changes to files.editor key, and apparently a change to files.editor requires students who already started the exercise to either "Revert to exercise start" or "Revert to last iteration" for such a change to appear to them. Updating the exercise is not enough. My guess is that they were also not seeing the cases_test.go file.

This should not be a problem for people who are recently starting the exercise completely fresh. june just sent me a mentoring request for "Word Search" and I can see the cases_test.go file:

image

I think this happens just because the exercise was started fresh.

A few weeks ago I opened a similar issue about files that were renamed not showing in the editor, even after an update: exercism/exercism#5954. I guess the underlying issue here is the same and the solution should also the same - the files in the editor won't update unless the user either "Revert to exercise start" or "Revert to last iteration". Like it was mentioned in that issue, I agree that this sort of updates should be done automatically or make more explicit to the user that the "files available" changed and prompt an action.

@junedev junedev added the chore Some cleanup/house-keeping needs to be done here. label Oct 23, 2021
@junedev junedev added the paused Work paused until further notice label Dec 10, 2022
@junedev junedev closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Some cleanup/house-keeping needs to be done here. paused Work paused until further notice
Projects
None yet
Development

No branches or pull requests

3 participants