Skip to content

Commit 56489fc

Browse files
committed
addressing comments and updating upgrades section
1 parent 7000e5b commit 56489fc

1 file changed

Lines changed: 8 additions & 34 deletions

File tree

AGENTS.md

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ External services and tools that tests depend on.
8888

8989
- **Broker**: VM/Container host provisioning
9090
- **Manifester**: Subscription manifest generation
91-
- **Report Portal**: Test result reporting
9291
- **Vault**: Secret management
9392

9493
---
@@ -270,8 +269,6 @@ def test_positive_create_activation_key(module_org, module_target_sat):
270269
271270
:expectedresults: Activation key is created successfully
272271
273-
:CaseImportance: Critical
274-
275272
:CaseAutomation: Automated
276273
"""
277274
ak = module_target_sat.api.ActivationKey(
@@ -599,41 +596,19 @@ def test_content_view_upgrade(upgrade_shared_satellite):
599596
```
600597

601598
**Key Concepts**:
602-
- `SharedResource`: Manages setup/verification in single test
603-
- `action=`: Function to run before upgrade
604-
- `.ready()`: Returns setup data after upgrade
605-
- Markers: `@pytest.mark.{feature}_upgrades`
606-
607-
### Old Upgrade Pattern (Legacy)
608-
609-
**Location**: `tests/upgrades/`
610-
611-
Uses separate pre/post tests with `@pytest.mark.pre_upgrade` and `@pytest.mark.post_upgrade`:
599+
- `SharedResource`: Represents a resource (for example, a Satellite) that can be operated on by multiple Xdist workers in parallel (for example, executing multiple tests against a single Satellite at the same time)
600+
- `resource_file`: A file that tracks the status of each Xdist worker operating on a SharedResource. The file is located in /tmp on the system executing tests.
601+
- `action=`: Function to be executed by a single Xdist worker when all workers are ready (for example, upgrading a Satellite after all workers have completed the setup portions of their respective tests)
602+
- `.ready()`: Changes an Xdist worker's status to 'ready' in the resource_file. If the worker is not the main worker, it will wait until the main worker has finished executing the `action` and then continue with the test. If the worker is the main worker, it will wait until all other workers are in status 'ready' and then execute the `action`.
612603

613-
```python
614-
@pytest.mark.pre_upgrade
615-
def test_cv_pre_upgrade(save_test_data):
616-
"""Setup before upgrade"""
617-
org = entities.Organization().create()
618-
save_test_data({'org_id': org.id})
619-
620-
@pytest.mark.post_upgrade(depend_on=test_cv_pre_upgrade)
621-
def test_cv_post_upgrade(pre_upgrade_data):
622-
"""Verify after upgrade"""
623-
org_id = pre_upgrade_data['org_id']
624-
org = entities.Organization(id=org_id).read()
625-
assert org.id == org_id
626-
```
627604

628605
**Run Commands**:
629606
```bash
630-
# Pre-upgrade stage
631-
pytest -m "pre_upgrade" tests/upgrades/
632-
633-
# Perform upgrade
607+
# Run all upgrade tests
608+
pytest tests/new_upgrades/ --upgrade
634609

635-
# Post-upgrade stage
636-
pytest -m "post_upgrade" tests/upgrades/
610+
# Run specific test file
611+
pytest tests/new_upgrades/test_activation_key.py --upgrade
637612
```
638613

639614
---
@@ -766,7 +741,6 @@ wait_for(
766741
**Problem**: `raise Exception("No hosts created during checkout")`
767742

768743
**Solution**:
769-
- Check Broker configuration in `broker_settings.yaml` and `broker/broker.py`
770744
- Verify inventory has available hosts
771745
- Check host requirements match available inventory
772746

0 commit comments

Comments
 (0)