Skip to content

Conversation

@Ang-m4
Copy link
Contributor

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

Description

This PR introduces integration tests for the Tutor Paragon plugin, using 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

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jun 5, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @Ang-m4!

This repository is currently maintained by @arbrandes.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@brian-smith-tcril
Copy link
Contributor

Thanks for adding these! I'd like to get tests in for more CLI options (multiple themes, source only, etc.) to make sure we're covering everything, but overall this is looking great!

@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Jun 12, 2025
@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
Contributor Author

Ang-m4 commented Jun 17, 2025

Hi @brian-smith-tcril,

As we previously discussed, I’ve implemented integration tests for most of the available Paragon options, based on the underlying logic and expected functionality.

I’d really appreciate your thoughts on this. Thanks so much for your attention and support!

Copy link
Contributor

@brian-smith-tcril brian-smith-tcril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! We can definitely add more integration tests if we hit any snags, but this feels like a good starting set. The patterns set forth in this PR should be very easy to follow for anyone adding tests in the future!

@brian-smith-tcril brian-smith-tcril merged commit 0850ccd into openedx:main Jun 17, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from In Eng Review to Done in Contributions Jun 17, 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

open-source-contribution PR author is not from Axim or 2U

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants