openedx / wg-devops

Issue repository for the DevOps Working Group
1 stars 1 forks source link

Fix lms & cms container environments to run tests without modification #23

Open kdmccormick opened 2 years ago

kdmccormick commented 2 years ago

Context

Here are the instructions on how to run tests in Tutor: https://docs.tutor.overhang.io/dev.html#running-edx-platform-unit-tests

Notice that:

  1. the lms container must be used, even for cms tests
  2. one needs to fiddle with a few different environment variables in order to run pytest on each root folder (lms, cms, common, openedx, xmodule).

Both of these limitations are awkward and potential stumbling blocks for developers.

Note on lms vs cms tests

edx-platform runs in one of two modes: LMS (the learning/instruction interface & APIs) and CMS (Studio and authoring APIs). Some code is specific to LMS or CMS, and some code is shared between the two. Both LMS and CMS have their own Django settings files.

In the edx-platform source tree...

edx-platform's PR checks ensure that the above is always true on the master branch.

Acceptance

Tweak edx-platform's test setup and/or Tutor's cms+lms dev container environments such that, without having to change any environment variables:

In other words, these should just work:

tutor dev run lms pytest lms/ xmodule/ common/ openedx/
tutor dev run cms pytest cms/ xmodule/ common/ openedx/

Notes

kdmccormick commented 2 years ago

@bradenmacdonald can you just leave a comment here? GH won't let me make you an assignee until you do.

bradenmacdonald commented 2 years ago

@kdmccormick Sure.

kdmccormick commented 2 years ago

@bradenmacdonald I'm going to start poking at this as I have time this week, and I'll post here if I learn anything. I don't know if your situation makes you more or less likely to work on this 😛 but if you do, let me know what you find!

bradenmacdonald commented 2 years ago

Ok sounds good @kdmccormick. Please let me know what you end up finding either way :)

kdmccormick commented 2 years ago

I've got a couple WIP PRs:

Haven't fully confirmed that they solve the problem, but I'm hopeful...

kdmccormick commented 2 years ago

The two PRs above are ready for feedback.

kdmccormick commented 2 years ago

Going to come back to this issue after the conference. See https://github.com/overhangio/tutor/pull/648#discussion_r857029417

kdmccormick commented 1 year ago

unfortunately I haven't been able to dig into this more, so I'm unassigning myself for now.

@bradenmacdonald were you still hoping to look into this, or should I unassign you?

bradenmacdonald commented 1 year ago

@kdmccormick I don't think I'll have time anytime soon unfortunately.