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 tests for the assignments app #40

Merged
merged 8 commits into from
Jun 29, 2024

Conversation

JasonGrace2282
Copy link
Member

@JasonGrace2282 JasonGrace2282 commented Jun 2, 2024

Goal

Add basic tests for every view in tin/apps/assignments/views.py (see #41 )

Feel free to help out ;)

Bonus

I added pytest-xdist to run tests in parallel (nobody likes a slow CI)

Progress

  • Basic assignment stuff
  • Graders
  • Files
  • Submissions
  • Quizzes
  • Scores
  • Folders

@JasonGrace2282 JasonGrace2282 force-pushed the more-tests branch 2 times, most recently from 9b4f1eb to 55dc358 Compare June 3, 2024 01:03
@JasonGrace2282
Copy link
Member Author

I didn't complete every single view in assignments, but I hit most and I think I'm happy with where it is right now.
This module should definitely be gone over again when adding tests for UI.

@JasonGrace2282 JasonGrace2282 marked this pull request as ready for review June 4, 2024 04:41
@JasonGrace2282 JasonGrace2282 requested a review from a team as a code owner June 4, 2024 04:41
@JasonGrace2282 JasonGrace2282 force-pushed the more-tests branch 6 times, most recently from 90a5932 to 348949b Compare June 6, 2024 03:10
krishnans2006
krishnans2006 previously approved these changes Jun 6, 2024
Copy link
Member

@krishnans2006 krishnans2006 left a comment

Choose a reason for hiding this comment

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

This is amazing - great work, thank you so much!

@JasonGrace2282 JasonGrace2282 force-pushed the more-tests branch 8 times, most recently from f2999ca to 348949b Compare June 6, 2024 04:39
@krishnans2006 krishnans2006 force-pushed the master branch 7 times, most recently from 4109c55 to e50df1a Compare June 9, 2024 20:12
@krishnans2006 krishnans2006 force-pushed the master branch 2 times, most recently from c03ce92 to 090d035 Compare June 9, 2024 20:47
@JasonGrace2282 JasonGrace2282 added the maintenance Dependencies, deprecation warnings, etc. label Jun 13, 2024
@JasonGrace2282 JasonGrace2282 force-pushed the more-tests branch 2 times, most recently from bb98a19 to 7f718d1 Compare June 14, 2024 04:53
@JasonGrace2282 JasonGrace2282 added area/testing Related to adding tests, or the infrastructure for tests app/assignments and removed maintenance Dependencies, deprecation warnings, etc. labels Jun 16, 2024
@JasonGrace2282 JasonGrace2282 force-pushed the more-tests branch 2 times, most recently from ba2b32c to ca353a6 Compare June 16, 2024 12:35
@JasonGrace2282 JasonGrace2282 mentioned this pull request Jun 17, 2024
12 tasks
Copy link
Member

@krishnans2006 krishnans2006 left a comment

Choose a reason for hiding this comment

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

Will test/merge after #50.

krishnans2006 pushed a commit that referenced this pull request Jun 29, 2024
For an example of the error, run `test_incorrect_files` from #40 locally
@krishnans2006
Copy link
Member

@JasonGrace2282 could you rebase this PR so I can test it with the changes from #50?

@JasonGrace2282
Copy link
Member Author

Done @krishnans2006 :)

Improves speed and fixes issues with sandboxing wrappers
Copy link
Member

@krishnans2006 krishnans2006 left a comment

Choose a reason for hiding this comment

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

To recap our conversation, any tests that edit the same file can have edge cases, so you'll need to account for those. For example, test_grader_view and test_download_grader both edit media/assignment-1/grader.py, so one of them can fail if they're timed poorly.

@krishnans2006 krishnans2006 merged commit 3ded115 into tjcsl:master Jun 29, 2024
3 checks passed
@JasonGrace2282 JasonGrace2282 deleted the more-tests branch July 23, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app/assignments area/testing Related to adding tests, or the infrastructure for tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants