Tox, for parallel test goodness - #1023
Conversation
|
This has now morphed into a "modernize ORA" PR. With the goal of faster, smaller, parallelized tests, I'll be doing the following:
|
979751f to
01cb48b
Compare
|
Running into an order-dependent flaky test in test_training.py, under |
| django-nose==1.4.4 | ||
| git+https://github.com/edx/django-rest-framework.git@1ceda7c086fddffd1c440cc86856441bbf0bd9cb#egg=djangorestframework==3.6.3 | ||
| dogapi==1.11.1 | ||
| jsonfield==2.0.2 |
There was a problem hiding this comment.
@michaelroytman just saw your recent branch - I'm upgrading jsonfield here as part of https://openedx.atlassian.net/browse/EDUCATOR-768
f591f51 to
c7138bc
Compare
d54f479 to
5d59212
Compare
| @@ -0,0 +1,22 @@ | |||
| # edX Internal Requirements | |||
| git+https://github.com/edx/XBlock.git@efischer/play_nice_with_py27#egg=XBlock==1.0.0 | |||
There was a problem hiding this comment.
Relies on https://github.com/edx/XBlock/pull/365, which is currently unmerged.
There was a problem hiding this comment.
Merged and updated
|
Ready for review! @cahrens has volunteered to be a reviewer (thanks again!); @edx/educator-dahlia FYI as well. Other subtasks before I close EDUCATOR-409:
|
| @@ -1,7 +0,0 @@ | |||
| Log files: | |||
|
|
|||
| apps_info.log = INFO level logging for all edx-ora2 apps and OpenAssessmentBlock | |||
There was a problem hiding this comment.
Should this information be captured someplace else? It seems like it could be useful (assuming it is still true).
There was a problem hiding this comment.
I don't believe this info is true any longer, edx-platform defines logging locations (which work with splunk), and this particular file is >3 years past its last update.
| ) | ||
| AssessmentPart.create_from_option_points(self.assessment, criterion_scores) | ||
| self.mark_complete_and_save() | ||
| # This file is empty, but we cannot delete it b/c historical migration records refer to it. |
There was a problem hiding this comment.
Is this still true given our discussion?
There was a problem hiding this comment.
I will double check on this one - it could be in a weird intermediary state from my internal debate about dealing with migrations.
| """ | ||
| # pylint:disable=W0611 | ||
| from .worker.training import train_classifiers, reschedule_training_tasks | ||
| from .worker.grading import grade_essay, reschedule_grading_tasks |
There was a problem hiding this comment.
Why is worker.grading removed?
There was a problem hiding this comment.
Everything under worker has been removed - the idea was to "train" your AI classifiers with a given data set ahead of time, then "grade" new essays as a separate phase. We don't need any references to either of these operations.
| try: | ||
| temp_url = swiftclient.utils.generate_temp_url( | ||
| path='%s/%s/%s' % (url.path, bucket_name, key_name), | ||
| path='/v%s%s/%s/%s' % (SWIFT_BACKEND_VERSION, url.path, bucket_name, key_name), |
There was a problem hiding this comment.
Will this cause any incompatibilities for people who are already using the Swift backend?
There was a problem hiding this comment.
It shouldn't, this only affects newly generated upload urls.
| from openassessment.assessment.models import PeerWorkflow | ||
|
|
||
|
|
||
| class Command(BaseCommand): |
There was a problem hiding this comment.
Why was this file deleted?
There was a problem hiding this comment.
I yanked out all performance tests as well, as they also heavily blurred the line between "python library" and "suite of scripts and programs to install, some of which may be python". The tests that were here were incredibly old, I think if we need performance testing against ora we're better off rewriting it in https://github.com/edx/edx-load-tests using the modern locust setup described there.
| # Expect that we generated a URL for the bucket | ||
| url = cmd.history[0]['url'] | ||
| self.assertIn("https://{}".format(self.BUCKET_NAME), url) | ||
| self.assertIn("ttps://s3.amazonaws.com/{}".format(self.BUCKET_NAME), url) |
There was a problem hiding this comment.
Why is the "h" missing from the front?
There was a problem hiding this comment.
Terrible copy-paste job by the dev who put this here, what a bum that guy must be (thanks, will fix)
| self.possible_points = 2 | ||
| peer_api.get_submission_to_assess(self.scorer_submission['uuid'], 1) | ||
| self.assessment = self._create_assessment(self.scorer_submission['uuid']) | ||
| self.assertEqual(self.assessment['parts'][0]['criterion']['label'], "criterion_1") |
There was a problem hiding this comment.
What caused this change (and the lines below, 475 and following?
There was a problem hiding this comment.
It was a flaky test issue. A particular hashseed value caused the assessment to store out-of-order values, until I made this fix. Now, this test ensures that self.assessment['parts'][0] matches up to the first criterion and appears first in the downloaded data.
|
|
||
| .action--save { | ||
| @extend %action-button | ||
| @extend %action-button !optional |
There was a problem hiding this comment.
It was failing quality builds, not sure why it hadn't been before. I'll double-check to ensure that's still the case.
There was a problem hiding this comment.
Example failure: https://travis-ci.org/edx/edx-ora2/jobs/257446578
| @extend %action-button !optional | ||
| } | ||
|
|
||
| .feedback { |
There was a problem hiding this comment.
Is there CSS that should be deleted related to AI grading? I'm thinking of the Studio editors, as well as the LMS view.
There was a problem hiding this comment.
Oh, good call. I'll do an audit of that before the next round of review
There was a problem hiding this comment.
I've poked around - no files are obviously AI grading exclusive, and I can't see any obvious removals in the existing files. Judging by that and the fact that very little HTML needed to be removed, I think we're safe assuming that this feature never had a lot of dedicated front-end customization done.
| # If the problem already contains example-based assessment | ||
| # then allow the editor to display example-based assessments, | ||
| # which is not included in the default | ||
| enabled_assessments = [asmnt['name'] for asmnt in self.valid_assessments] |
There was a problem hiding this comment.
Have you checked that no ORA instances in prod/Edge have AI steps defined? Just wondering how they would fail.
There was a problem hiding this comment.
From my database poking, I don't believe there are any. I'll verify that, and set up such a problem locally to ensure we can handle that situation correctly.
| #!/usr/bin/env bash | ||
|
|
||
| MAX_PEP8_VIOLATIONS=106 | ||
| MAX_PEP8_VIOLATIONS=62 # TODO nomerge - but also stop failing during development |
There was a problem hiding this comment.
Don't forget to follow up on this.
| #!/usr/bin/env bash | ||
|
|
||
| MAX_PYLINT_VIOLATIONS=438 | ||
| MAX_PYLINT_VIOLATIONS=495 # TODO nomerge - but also stop failing during development |
There was a problem hiding this comment.
Don't forget to follow up on this.
| Performance Tests | ||
| ================= | ||
|
|
||
| 1. Install performance test requirements: |
There was a problem hiding this comment.
No more performance tests?
There was a problem hiding this comment.
Correct, I've eliminated them from this repo for reasons outlined above.
|
What are the .gitkeep files? |
|
Alright @cahrens, I believe this is ready again, I've addressed all your comments from before. The diff of the latest commit looks scary, but a large portion of it was me running I'm also running acceptance tests at https://gocd.tools.edx.org/go/pipelines/value_stream_map/build_ora2_sandbox/142. |
| # edX Internal Requirements | ||
| git+https://github.com/edx/XBlock.git@xblock-0.4.12#egg=XBlock==0.4.12 | ||
| # edx-submissions>=2.0.6,<3.0.0 #TODO: update after 2.0.6 release | ||
| git+https://github.com/edx/edx-submissions.git@efischer/loosen_reqs#egg=edx-submissions==2.0.6 # TODO: and remove this line |
There was a problem hiding this comment.
These two lines are effectively "I'm waiting for openedx/edx-submissions#65 to merge before this"
| # Install commands | ||
| ################## | ||
| install-python: | ||
| pip install -r requirements/django.txt |
There was a problem hiding this comment.
I see-- because of the tox configuration. Never mind.
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): |
There was a problem hiding this comment.
What caused this migration?
There was a problem hiding this comment.
It's the same thing that's happening here - We can remove the django_extensions dependency fairly easily, but that touches a field on a model, which leads to a migration. Said migration should be a no-op, but there are some pending operational questions to sort out.
The migration should have been in the last commit; I had forgotten that it needed to be generated and ran into a "please run makemigrations" warning while fixing other things. I'll work out the details with Kevin on my other PR and update this one with the results of that conversation.
There was a problem hiding this comment.
Update: we're pushing the submissions upgrade through independently, as it had an identical migration. Expectation is that it runs as a no-op, we're going to verify that as submissions goes out since it's a smaller table.
| # edX Internal Requirements | ||
| # edx-submissions>=2.0.6,<3.0.0 #TODO: update after 2.0.6 release | ||
| git+https://github.com/edx/edx-submissions.git@efischer/loosen_reqs#egg=edx-submissions==2.0.6 # TODO: and remove this line | ||
| git+https://github.com/edx/django-rest-framework.git@1ceda7c086fddffd1c440cc86856441bbf0bd9cb#egg=djangorestframework==3.6.3 |
There was a problem hiding this comment.
Why a specific commit of django-rest-framework?
There was a problem hiding this comment.
@doctoryes set this requirement to a specific commit in #1024, I'm just moving it to another file
| known_third_party = ddt,mock | ||
| known_django = django | ||
| known_djangoapp = jsonfield,model_utils | ||
| known_edx = |
There was a problem hiding this comment.
Yeah, it has something to do with isort configuration. I copied this over from https://github.com/edx/edx-celeryutils/blob/master/setup.cfg, I think we can remove the known_edx line
| @@ -93,6 +92,12 @@ | |||
| 'django.template.loaders.filesystem.Loader', | |||
There was a problem hiding this comment.
These are the default values, so TEMPLATE_LOADERS can be removed.
https://docs.djangoproject.com/en/1.11/ref/templates/upgrading/
| from celery import Celery | ||
|
|
||
| DEBUG = True | ||
| TEMPLATE_DEBUG = DEBUG |
There was a problem hiding this comment.
I believe you should remove TEMPLATE_DEBUG. You can include 'debug' in the TEMPLATES options.
For example,
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [
os_path.join(PROJECT_PATH, 'templates'),
],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
"django.contrib.auth.context_processors.auth",
"django.template.context_processors.debug",
"django.template.context_processors.i18n",
"django.template.context_processors.media",
"django.template.context_processors.static",
"django.template.context_processors.request",
"django.template.context_processors.tz",
"django.contrib.messages.context_processors.messages",
"sekizai.context_processors.sekizai",
],
'debug': DEBUG,
},
},
]
There was a problem hiding this comment.
Also, STATICFILES_DIRS and STATICFILES_FINDERS can be removed.
https://docs.djangoproject.com/en/1.11/ref/settings/#std:setting-STATICFILES_FINDERS
|
@efischer19 done re-reviewing-- just a few more comments/questions. |
|
Thanks for the review @cahrens! I think I've answered all your questions, will get this updated witch code changes and ready for merge in the next day or so. |
This work was done in the context of a larger PR, I'd be shocked if this commit can be successfully reverted by itself. If you're trying to restore AI grading though, it's a good place to start.
fc3da33 to
7064f90
Compare
|
We're back - latest commit has:
Once tests have passed and everyone is happy, I'll get this squashed, merged, and deployed |
7064f90 to
63413e9
Compare
|
👍 |
Contains installation and testing changes for the django 1.11 upgrade preparedness initiative. Splits tests out into seperate shards on travis.
Code changes needed to work with the upgraded dependencies from the previous commit.
63413e9 to
3e13d27
Compare
|
🎆 Thanks for the help here @cahrens! I'm going to get this deployed tomorrow |
|
🚀 |

EDU-768
Attempts to split each of the following into separate test contexts on travis: