-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: add integration tests for the enrollments api AP-1346
#280
base: master
Are you sure you want to change the base?
Conversation
517d530
to
0e54e60
Compare
AP-1346
7bf9213
to
0b9bcb8
Compare
dbd0ecf
to
c6af9f6
Compare
af33974
to
5af2d39
Compare
5af2d39
to
e80e6a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave this so you can commit them in bulk.
@@ -7,7 +7,11 @@ jobs: | |||
runs-on: ubuntu-latest | |||
strategy: | |||
matrix: | |||
tutor_version: ['<18.0.0', '<19.0.0'] | |||
include: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BryanttV can we please explain why is this implementation necessary in the PR description? I think it's important to explain the reasoning behind this decision
Since I’m considering moving tutor local do importdemocourse
to the GitHub Action, should we also pass the course ID to the environment in the step that runs the integration tests? This way, the action would handle the full demo course setup, and we can ensure that the tests always reference the correct course and prevent each plugin from setting it manually
I was able to obtain the course ID dynamically with:
COURSE_KEY=$(tutor local exec lms python manage.py lms shell -c "from openedx.core.djangoapps.content.course_overviews.models import CourseOverview; course = CourseOverview.objects.first(); print(course.id, end='')")
However, if the import process changes in future Open edX versions, this could break the tests. Of course, we could always introduce version-based logic to handle that, but we could also just set the course ID manually in the action (assuming the Demo course ID won’t change frequently). Starting from Tutor version 18.0.0, the ID is course-v1:OpenedX+DemoX+DemoCourse
, so we’d handle logic for both IDs for now, and remove support for versions below 18.0.0 later
I’d like to hear your thoughts on this approach @BryanttV @mariajgrimaldi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like what you propose. I think it's more appropriate to leave that responsibility to the action, than to keep it in every plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should definitely move this to the GH action itself.
I like the proposal's automatic approach to getting the course ID. However, I'm very wary of using code from the platform without any API or interface, even from the shell. I don't think it's worth it, considering the course ID hasn't changed much over time. The last change was very much needed: openedx/openedx-demo-course#50, it looks like it was very axim-specific for some reason.
9aa144a
to
6f68900
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave my approval again once we address the last couple of comments. Thank you!
abefbb2
to
b29faf0
Compare
b29faf0
to
6ba8bb0
Compare
This reverts commit 6ba8bb0.
182be1f
to
cb6ce0b
Compare
964d1c5
to
8cb8b3d
Compare
8cb8b3d
to
c5607d3
Compare
Description
This PR adds integration tests for the enrollment API. These tests are executed in the job of Tutor Integration Tests
This PR is part of a set of PRs to add integration tests to the enrollment API. It must be separated into different PRs because doing it in one PR exceeds the maximum size allowed by the pr-size-labeler action.
AP-1346
#281AP-1346
#282Testing instructions
Check the jobs of Tutor Integration Tests in the PR.
Jira Issue