Skip to content

Conversation

@Ang-m4
Copy link
Collaborator

@Ang-m4 Ang-m4 commented Jun 3, 2025

Description

This PR introduces integration tests for the Tutor Paragon plugin, utilizing Pytest to validate the plugin's setup and functionality. These tests ensure that the plugin is correctly installed, enabled, and operates as expected within the Tutor environment.

Key Enhancements

Logging Improvements

  • Replaced print statements with logger.info for logging plugin installation processes. This change enhances log management and prevents interference with test output, especially when retrieving the Tutor installation root.

Pytest Fixtures and Configuration

  • Introduced Pytest fixtures in integration/conftest.py with package level scope to:

    • Enable the Tutor Paragon plugin before tests run.
    • Build the Paragon builder Docker image prior to test execution.
  • These fixtures ensure a consistent and isolated testing environment, adhering to Pytest's best practices for setup and teardown processes.

Helper Module

  • Added a helpers.py module within the integration/ directory containing:

    • Global variable declarations for plugin names, image names, and directory paths.
    • Utility functions to execute Tutor commands and retrieve the Tutor root path.

Integration Test Suite

  • Developed integration tests within the integration/ directory to verify:

    • The Paragon plugin is installed and enabled (plugin_setup_test.py).
    • Essential directories (theme-sources and compiled-themes) are created.
    • The paragon-build-tokens job is available in Tutor's configuration.
    • Core plugin functionality behaves as expected (plugin_functionality_tests.py).

Makefile Update

  • Added a new Makefile target make integration-tests to streamline the execution of integration tests.

Project Structure

tests/
└── integration/
    ├── conftest.py
    ├── helpers.py
    ├── plugin_setup_test.py
    └── plugin_functionality_tests.py

How to Run Integration Tests

Execute the following command to run the integration tests:

make integration-tests

@Ang-m4 Ang-m4 force-pushed the afg/tutor-paragon-tests branch from 5b06b42 to 5d13647 Compare June 4, 2025 00:03
@Ang-m4 Ang-m4 marked this pull request as ready for review June 4, 2025 00:04
@Ang-m4 Ang-m4 requested a review from Alec4r June 4, 2025 00:04
@Ang-m4 Ang-m4 force-pushed the afg/tutor-paragon-tests branch from dd9b001 to 479967e Compare June 5, 2025 16:42
@Ang-m4 Ang-m4 force-pushed the afg/tutor-paragon-tests branch from 479967e to af0ab37 Compare June 17, 2025 02:03
@Ang-m4
Copy link
Collaborator Author

Ang-m4 commented Jun 23, 2025

This PR was reviewed and successfully merged, take a look at openedx#36

@Ang-m4 Ang-m4 closed this Jun 23, 2025
@Ang-m4 Ang-m4 deleted the afg/tutor-paragon-tests branch June 30, 2025 18:01
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.

3 participants