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

fix: Serialize list problem_check results as JSON #366

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

bmtcril
Copy link
Contributor

@bmtcril bmtcril commented Nov 6, 2023

Description:

Prior to this fix, TinCan would use the repr of the list, which made some responses effectively un-parseable downstream.

closes #365

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

Post merge:

  • Create a tag
  • Check new version is pushed to PyPI after tag-triggered build is
    finished.

Author concerns: This is a bit of a hack around TinCan, and also TinCan hasn't been updated in 3 yrs. We should consider forking it or replacing it. 😬

@bmtcril bmtcril closed this Nov 6, 2023
@bmtcril bmtcril reopened this Nov 6, 2023
@bmtcril
Copy link
Contributor Author

bmtcril commented Nov 6, 2023

This is in draft while I test the changes in Aspects.

@bmtcril bmtcril force-pushed the bmtcril/list_problem_check_fix branch from ed4a1b9 to f0b7034 Compare November 6, 2023 19:38
Prior to this fix, TinCan would use the repr of the list, which
made some responses effectively un-parseable downstream.
@bmtcril bmtcril force-pushed the bmtcril/list_problem_check_fix branch from f0b7034 to b32afcd Compare November 6, 2023 19:59
Copy link
Contributor

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

Couple of nits, but this LGTM @bmtcril :) 👍

  • I tested this by running this branch on my Tutor devstack while sending problem_check events through the LMS, ensuring that they're still read as expected on Aspects.
  • I read through the code
  • I checked for accessibility issues N/A
  • Includes documentation

@@ -119,6 +119,7 @@ def test_event_transformer(self, event_filename, mocked_uuid4):
try:
self.compare_events(actual_transformed_event, expected_event)
except Exception as e: # pragma: no cover
print("Comparison failed, writing output to test_output for debugging")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: debugging statement can be removed

Suggested change
print("Comparison failed, writing output to test_output for debugging")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this because every time I'm in that code I am confused by what it's doing, and there is nothing in the rest of the test run that references that this functionality exists. It's handy so I want to make sure people know it's there! So I'd like to keep some version of it, but I'm happy to present it in a different way if there's a better one, though.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's fine to leave as-is if it's useful; I just have a knee-jerk reaction to print statements :)

@bmtcril bmtcril marked this pull request as ready for review November 7, 2023 13:47
@bmtcril bmtcril requested a review from Ian2012 November 7, 2023 13:47
@bmtcril
Copy link
Contributor Author

bmtcril commented Nov 7, 2023

I've also tested in Aspects with an updated schema and it looks good.

Prior to this fix, TinCan would use the repr of the list, which
made some responses effectively un-parseable downstream.
@bmtcril bmtcril force-pushed the bmtcril/list_problem_check_fix branch from 5c58ade to 9847748 Compare November 7, 2023 13:52
@bmtcril bmtcril merged commit 202ca1b into master Nov 8, 2023
8 checks passed
@bmtcril bmtcril deleted the bmtcril/list_problem_check_fix branch November 8, 2023 14:28
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.

Improve parsing for problem answers
3 participants