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

🔨(project) bind edx sources to host directories #21

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ node_modules

e2e/cypress/screenshots
e2e/cypress/videos

# Don't lint edX sources
edx/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ e2e/edx_courses_config.json
# JS dependencies
node_modules

# EdX src and modules
edx/src
edx/modules/

# logs
yarn-error.log
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ e2e/data/video.mp4: ## generate a 5 second long video and put it in e2e/data di
-vcodec libx264 -preset superfast -tune zerolatency -pix_fmt yuv420p -t 5 \
-movflags +faststart "/e2e/data/video.mp4"

edx/src: ## directory to mount named bind volume for the edX-platform sources
mkdir -p edx/src

edx/modules: ## directory to mound named bind volume for the edX python modules
mkdir -p edx/modules

# Make commands

bootstrap: ## bootstrap the project
bootstrap: \
edx/src \
edx/modules \
migrate \
run \
realm
Expand Down
18 changes: 18 additions & 0 deletions docker-compose.edx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ services:
DJANGO_SETTINGS_MODULE: lms.envs.fun.docker_run
ports:
- "8072:8000"
- "3001:3000"
user: ${DOCKER_UID}:${DOCKER_GID}
volumes:
- ./data/edx/media:/edx/var/edxapp/media
- ./data/edx/store:/edx/app/edxapp/data
- ./edx/config:/config
- edx_src:/edx/app/edxapp/edx-platform
- edx_modules:/usr/local/src
- ./docker/files/usr/local/bin/auth_init:/usr/local/bin/auth_init
command: >
python manage.py lms runserver 0.0.0.0:8000
Expand Down Expand Up @@ -81,3 +84,18 @@ services:
networks:
potsie:
external: true

volumes:
edx_src:
driver: local
driver_opts:
type: volume
o: bind
device: ./edx/src

edx_modules:
driver: local
driver_opts:
type: volume
o: bind
device: ./edx/modules
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ describe("LMS Drag And Drop Problem Interaction Test", () => {
before(() => {
cy.lmsLoginStudent();
cy.lmsEnroll(true);
// Reset Problem
const { courseId } = Cypress.env("EDX_COURSES").demoCourse1;
const handlerURL = "handler/xmodule_handler/problem_reset";
const url = `/courses/${courseId}/xblock/${problem.locator}/${handlerURL}`;
const method = "POST";
const body = { id: problem.locator };
cy.request({ url, method, body }).then((response) => {
expect(response.status).to.equal(200);
});
// Navigate to the courseware.
cy.visit(sectionUrl);
// Input answers (first image).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ describe("LMS JS Input Response Problem Interaction Test", () => {
cy.lmsEnroll(true);
// Navigate to the courseware.
cy.visit(sectionUrl);
// Wait for iframe to become interactive.
cy.wait(1500);
// Input wrong answers.
cy.get(`#iframe_${problemId}_2_1`).click(118, 200);
cy.wait(200);
// Submit answer.
cy.get(".check.Valider").click();
cy.get(".check.Valider").should("not.have.class", "is-disabled");
Expand Down