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

Allow instructors to configure an end date until which students can run automated tests #6992

Merged
merged 18 commits into from
Mar 31, 2024

Conversation

Bruce-8
Copy link
Contributor

@Bruce-8 Bruce-8 commented Mar 8, 2024

Motivation and Context

Closes #6822. Currently, MarkUs allows instructors to enable a "start date" at which students can begin running "student-run tests". Tests can be run up until the assignment due date. This pull request augments this functionality to allow the instructor to configure an end date until which students can run tests. If the end date is left blank, the existing functionality (up until assignment due date) will be used instead.

Your Changes

Description:

  • Performed a database migration to add a token_end_date attribute to assignment_properties.
  • Added a new date picker box in the automated testing view of the web UI (instructor side) that allows instructors to select the value for token_end_date.
  • Updated the logic by adding new policies in assignment_policy and student_policy that check for whether the student can run automated testing based on the value for token_end_date.

Type of change (select all that apply):

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to change)

Testing

  • Manually tested whether instructors can successfully configure an end date for student autotests in the web UI.
  • Manually tested whether students can run or not run automated tests based on the configured token_end_date in the web UI.
  • Added RSpec unit tests to check for the logic mentioned above.

Questions and Comments (if applicable)

Just checked with my group members as well and wanted to bring to your attention that the flaky test file spec/system/main/login_spec.rb is not passing, but I checked to make sure that it's not because of my changes.

Checklist

  • I have performed a self-review of my own code.
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported on Coveralls.
  • I have added tests for my changes.
  • I have updated the Changelog.md file.

@Bruce-8 Bruce-8 marked this pull request as ready for review March 22, 2024 04:11
@coveralls
Copy link
Collaborator

coveralls commented Mar 22, 2024

Pull Request Test Coverage Report for Build 8498291012

Details

  • 44 of 44 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 91.653%

Totals Coverage Status
Change from base Build 8498218632: 0.02%
Covered Lines: 40299
Relevant Lines: 43303

💛 - Coveralls

@Bruce-8 Bruce-8 requested a review from david-yz-liu March 22, 2024 05:12
@@ -31,6 +31,7 @@ en:
short_identifier: Short Identifier
start_time: Start time
student_form_groups: Students may form their own groups
token_end_date: Tokens will be unavailable on
Copy link
Collaborator

Choose a reason for hiding this comment

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

reword to "Tokens available until"

@@ -18,6 +18,7 @@ en:
view_ta_subtabs?: You are not authorized to perform this action.
assignment:
autogenerate_group_name?: This assignment does automatically generate group names.
before_token_end_date?: The token end date for this assignment has passed.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reword to "Tokens are no longer available for this assignment."

db/structure.sql Outdated
-- Name: index_assignment_properties_on_token_end_date; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_assignment_properties_on_token_end_date ON public.assignment_properties USING btree (token_end_date);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should no longer exist, since you removed it from the migration. This indicates that this file is out of sync with your migration. The easiest way to fix this is to revert all changes in this specific file, then re-run the migration.

@@ -80,6 +80,7 @@ class AutotestSetup
repository_folder: @assg_short_id,
enable_test: true,
token_start_date: Time.current,
token_end_date: Time.current,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is for seeding, but it should also be okay to set this to nil so that the field is blank (this is the default behaviour)

check?(:tokens_available?, grouping)
end
unless grouping.nil? || assignment.nil?
if !assignment.token_end_date.nil?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use .present? instead of ! ... .nil?

@Bruce-8 Bruce-8 requested a review from david-yz-liu March 28, 2024 19:32
@Bruce-8 Bruce-8 requested a review from david-yz-liu March 31, 2024 00:22
@david-yz-liu david-yz-liu merged commit d850413 into MarkUsProject:master Mar 31, 2024
6 checks passed
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.

Allow students to run tests after the due date AB#122
3 participants