-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
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.
Continuous Integration (CI) testing is set up to run automatically on every pull request. The CI pipeline includes the following steps:
- ⚙️ Build Package: The package is built to ensure that all dependencies are correctly installed and the code compiles without errors.
- 🧩 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.
To run tests locally, follow these steps:
-
Install Pytest: You can use
pip install pytestto install pytest for Python testing. - Go to the LabLink Client Service Directory: Navigate to the directory where the LabLink code is located.
-
Run Tests: Execute the tests using the command
PYTHONPATH=. pytestin the terminal. - 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.
To test the "Update Inuse Status" feature in the LabLink client service (update_inuse_status.py), follow these steps:
- ⚙️ Configure LabLink Allocator: Ensure that the LabLink Allocator is configured correctly to manage the allocation of resources.
- 💻 Create Client VMs: Set up two virtual machines (VMs) with
lablink-client-servicepip package installed to simulate the LabLink client environment via Lablink Allocator Website. - 📥 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.
- 🔍 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.
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:
- ⚙️ Configure LabLink Allocator: Ensure that the LabLink Allocator is set up to manage resources and that the client service is running.
- 💻 Create Client VMs: Set up two virtual machines (VMs) with
lablink-client-servicepip package installed to simulate the LabLink client environment via Lablink Allocator Website. - 🔍 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.