autograding icon indicating copy to clipboard operation
autograding copied to clipboard

Autograding with points stops working if any tests are edited

Open mh-skjelvareid opened this issue 1 year ago • 13 comments

Autograding allows for automatically awarding points when individual tests pass. If you create the tests and don't touch them again, it works. However: If you edit any tests, all the test points become blank. If you try resetting the points for a test, the changes are not saved.

If you have a test user and clone the repository for the assignment, you can see how the points are missing by opening .github/classroom/autograding.json . All points are set to null.

This behavior has been observed by multiple users:

  • https://github.com/orgs/community/discussions/67008
  • https://github.com/orgs/community/discussions/67572

Minimal example to recreate:

  • Create a new assignment
  • Create a test, e.g. based on pytest (run pytest test.py) and set a number of points for the test (e.g. 5)
  • Save the test and the assignment
  • Re-open the assignment and edit the test - the point field is now blank

mh-skjelvareid avatar Oct 16 '23 12:10 mh-skjelvareid

Ah, this is likely a problem in Github Classroom not the auto grading itself. I wonder if @zrdaley knows?

jeffrafter avatar Oct 16 '23 14:10 jeffrafter

cc @ryanhecht

juanpflores avatar Oct 16 '23 17:10 juanpflores

~I have the same problem, github classroom does not even show the points list anymore.~

Never mind, it seems to work now. I do have the same problem as above.

alexandruradovici avatar Oct 19 '23 10:10 alexandruradovici

There is another problem, it seems that whenever we modify something in the tests, the autograding file is updated in the student's repository, but the job is not rerun, it is skipped. Students have to push another modification to see the changes. This is very frustrating.

alexandruradovici avatar Oct 21 '23 10:10 alexandruradovici

+1 Same for me. I switched to GH Classrooms due to the autograding feature for this term's introductory to object-oriented programming course, but the current state is very frustrating (for the students and for me).

heiko-holz avatar Oct 25 '23 11:10 heiko-holz

Hey folks! We've opened an issue for this internally and are working on a fix. I'll update this issue when the fix has been deployed!

RyanHecht avatar Oct 25 '23 15:10 RyanHecht

This should be resolved now! :)

RyanHecht avatar Oct 26 '23 14:10 RyanHecht

Is there any way we could add a feature to be able to upload the autograder.json file to github classroom? We have around 70 tests that we have to input manually.

alexandruradovici avatar Oct 26 '23 14:10 alexandruradovici

@alexandruradovici You can add the autograder.json (and the .github/workflows/classroom.yml) to a template repo and use that as the starter code source for a GH Classroom assignment.

The tests won't be imported into GH Classroom, but they will still run, and the points will still be reported back to GH Classroom. (It would be really nice if it was possible to import autograder.json into GH Classroom though.)

markpatterson27 avatar Oct 28 '23 17:10 markpatterson27

This should be resolved now! :)

@RyanHecht

I still have this 'skipped' issue when I update the test cases of an assignment. I tried it on a newly created assignment, but it is still the case. I do not want to re-run workflows one by one or rely on students to do it themselves. Can you tell me how I can fix this?

myavuz21 avatar Nov 02 '23 19:11 myavuz21

Looks like they've added if: github.actor != 'github-classroom[bot]' to the generated classroom.yml workflow. This will 'skip' the workflow for any commits made by github-classroom, such as when updating assignments.

I'd argue that most people would prefer @myavuz21's way, where the tests re-run whenever they are changed (i.e., even for commits made by github-classom[bot]).

markpatterson27 avatar Nov 03 '23 15:11 markpatterson27

Ah, this is likely a problem in Github Classroom not the auto grading itself. I wonder if @zrdaley knows?

this is now closed source, right ? Just wondering, because there seem to be a few other backend-level issues, especially when it comes to using reusable workflows, which prepend/prefix the name of the action and thus modify the whole name, which in turn renders output.ts (points reporting) dysfunctional, because there's the hard-coded assumption that the autograding stage is indeed called "Autograding" (it's used as a lookup key for the octkit API call) - and not even fixing that, solves the problem - since the github classroom UI also seems to be using the hard-coded "Autograding" name internally.

Assuming this is hard to get fixed (given that this stuff is now closed-source), it might make sense to mention this much more prominently in the docs ...

Thanks

GittyBitch avatar Nov 18 '23 21:11 GittyBitch

Hello, it seems that you found a way to award point per passed test case. Would you be able to share how? I can only see a way to award point for a whole test suite. I would love to see how many test have pased or failed in that suite. I am using node.js and vitest.

tomitrescak avatar Apr 19 '24 05:04 tomitrescak