Skip to content

Testing

7174Andy edited this page Jul 24, 2025 · 2 revisions

Testing Workflow

This document outlines the testing workflow for LabLink. It includes the steps to run tests, the types of tests available, and how to interpret the results.

🔄 CI Testing

Continuous Integration (CI) testing is set up to run automatically on every pull request. The CI pipeline includes the following steps:

  1. ⚙️ Build Package: The package is built to ensure that all dependencies are correctly installed and the code compiles without errors.
  2. 🧩 Run Unit Tests: All unit tests are executed to verify that individual components of the codebase function as expected.

❗ Note: The CI pipeline does not run integration tests.

This is because integration tests require a specific environment setup that is not feasible to automate in the CI environment. Also, the unit tests are mock tests, meaning they do not interact with real external systems or databases.

🧪 Local Testing for Lablink Client Service

To run tests locally, follow these steps:

  1. Install Pytest: You can use pip install pytest to install pytest for Python testing.
  2. Go to the LabLink Client Service Directory: Navigate to the directory where the LabLink code is located.
  3. Run Tests: Execute the tests using the command PYTHONPATH=. pytest in the terminal.
  4. View Test Results: After the tests have run, you can view the results in the terminal output. Look for any failed tests and investigate the issues.

🖥️ Test Update Inuse Status Feature in LabLink Client Service

To test the "Update Inuse Status" feature in the LabLink client service (update_inuse_status.py), follow these steps:

  1. ⚙️ Configure LabLink Allocator: Ensure that the LabLink Allocator is configured correctly to manage the allocation of resources.
  2. 💻 Create Client VMs: Set up two virtual machines (VMs) with lablink-client-service pip package installed to simulate the LabLink client environment via Lablink Allocator Website.
  3. 📥 Get a VM Assigned: Use the LabLink Allocator to get a VM assigned. This will allow you to connect to the VM and test the feature via Chrome Remote Desktop.
  4. 🔍 Test the Feature: Once connected to the VM, you can test the "Update Inuse Status" feature by running the subject software in the VM. Ensure that the status updates correctly and reflects the expected behavior in the database. The status can be viewed in the LabLink Allocator Website to confirm that the update was successful.

🖥️ Test GPU Health Check Feature in LabLink Client Service

To test the "GPU Health Check" feature in the LabLink client service (check_gpu.py). When the LabLink client service is running, it will automatically check the GPU health status every 20 seconds. To test this feature, follow these steps:

  1. ⚙️ Configure LabLink Allocator: Ensure that the LabLink Allocator is set up to manage resources and that the client service is running.
  2. 💻 Create Client VMs: Set up two virtual machines (VMs) with lablink-client-service pip package installed to simulate the LabLink client environment via Lablink Allocator Website.
  3. 🔍 Monitor GPU Health: Once connected to the VM, you can monitor the GPU health status in the LabLink Allocator Website. Check for any alerts or issues reported by the client service.

Clone this wiki locally