You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document describes the lifecycle feature integration tests implemented in this repository, including the approach taken and the rationale behind design decisions.
3
+
This document provides comprehensive guidance for lifecycle feature integration tests, including test architecture, implementation approach, running tests (both API and daemon modes), and detailed requirements coverage.
4
4
5
5
## Overview
6
6
@@ -17,9 +17,35 @@ Lifecycle feature integration tests verify that applications can properly integr
17
17
9.**Configuration** — Modular configuration and session management
18
18
10.**Debug & Logging** — Debug support, terminal support, and logging
19
19
20
+
## Test Modes
21
+
22
+
The lifecycle tests can run in two complementary modes:
23
+
24
+
### 1. API Integration Mode (Default)
25
+
26
+
Tests call lifecycle APIs but don't require a running daemon. This validates:
27
+
28
+
- API signatures and integration patterns
29
+
- Correct API usage in application code
30
+
- Language bindings (Rust and C++) work correctly
31
+
32
+
**When to use**: CI/CD pipelines, quick feedback, API contract validation
33
+
34
+
### 2. Daemon Integration Mode
35
+
36
+
Tests run with an actual Launch Manager daemon instance. This validates:
37
+
38
+
- End-to-end supervision and monitoring behavior
39
+
- Process recovery and health checks
40
+
- Runtime configuration management
41
+
42
+
**When to use**: Integration validation, E2E testing, behavior verification
43
+
20
44
## Requirements Coverage Summary
21
45
22
-
This test suite covers 85 of 92 lifecycle requirements from the S-CORE Platform specification (92% coverage). The tests validate API integration patterns for both Rust and C++ implementations.
46
+
This test suite covers **85 of 92 lifecycle requirements** from the S-CORE Platform specification (**92% coverage**). The tests validate API integration patterns for both Rust and C++ implementations.
47
+
48
+
> **Note**: All tests should be run using Bazel. Direct pytest execution is a work in progress.
23
49
24
50
**Coverage by Category:**
25
51
@@ -356,7 +382,6 @@ The tests are designed to run in environments without the Launch Manager daemon.
356
382
**Rationale**:
357
383
358
384
-**Separation of Concerns**: Python for orchestration, Rust/C++ for implementation
359
-
-**Language-Appropriate Testing**: Leverages pytest for test management
360
385
-**Reusability**: Base scenario class reduces code duplication
361
386
-**Flexibility**: Easy to add new test scenarios or languages
362
387
@@ -399,7 +424,27 @@ All scenarios are implemented in both Rust and C++:
399
424
400
425
## Running the Tests
401
426
402
-
### Using Bazel (Recommended)
427
+
### Quick Reference
428
+
429
+
**Run all non-daemon tests (Rust and C++):**
430
+
431
+
```bash
432
+
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_rust
433
+
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_cpp
434
+
```
435
+
436
+
**Run daemon integration tests (Rust and C++):**
437
+
438
+
```bash
439
+
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_daemon_rust
440
+
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_daemon_cpp
441
+
```
442
+
443
+
### Quick Start
444
+
445
+
#### API Integration Tests (Fast, No Daemon Required)
446
+
447
+
**Using Bazel:**
403
448
404
449
Run all lifecycle tests (both languages):
405
450
@@ -410,7 +455,7 @@ bazel test --config=linux-x86_64 \
410
455
--test_filter="*lifecycle*"
411
456
```
412
457
413
-
Run specific language:
458
+
**Run specific language:**
414
459
415
460
```bash
416
461
# Rust only
@@ -420,45 +465,43 @@ bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_rust
420
465
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_cpp --test_filter="*lifecycle*"
421
466
```
422
467
423
-
Run specific test file:
468
+
**Run specific test file:**
424
469
425
470
```bash
426
471
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_cpp \
bazel test --config=linux-x86_64 //feature_integration_tests/test_cases:fit_daemon_rust --test_output=all
443
486
```
444
487
445
-
Run tests for specific implementation (rust or cpp):
488
+
### Understanding Build Configurations
446
489
447
-
```bash
448
-
pytest test_cases/tests/lifecycle/ -k "rust"
449
-
pytest test_cases/tests/lifecycle/ -k "cpp"
450
-
```
490
+
**Bazel `--config` flag:**
491
+
492
+
-`--config=linux-x86_64`: Builds for Linux x86_64 platform
493
+
-`--config=qnx-x86_64`: Builds for QNX x86_64 platform
451
494
452
495
### Debug Individual Scenarios
453
496
454
-
List available scenarios:
497
+
**List available scenarios:**
455
498
456
499
```bash
457
500
bazel run //feature_integration_tests/test_scenarios/rust:rust_test_scenarios -- --list-scenarios
458
501
bazel run --config=linux-x86_64 //feature_integration_tests/test_scenarios/cpp:cpp_test_scenarios -- --list-scenarios
459
502
```
460
503
461
-
Run a scenario directly:
504
+
**Run a scenario directly:**
462
505
463
506
```bash
464
507
bazel run //feature_integration_tests/test_scenarios/rust:rust_test_scenarios -- \
@@ -467,6 +510,8 @@ bazel run //feature_integration_tests/test_scenarios/rust:rust_test_scenarios --
467
510
468
511
## Test Configuration
469
512
513
+
### Scenario Configuration
514
+
470
515
Scenarios accept JSON configuration to customize test behavior. Common parameters include:
471
516
472
517
**Base parameters** (used by most scenarios):
@@ -502,6 +547,60 @@ Scenarios accept JSON configuration to customize test behavior. Common parameter
502
547
503
548
The Python test files build appropriate configurations for each scenario automatically.
504
549
550
+
### Launch Manager Configuration
551
+
552
+
When running daemon integration tests, the Launch Manager requires a configuration file. The daemon fixture automatically creates this, but you can customize it for your tests:
553
+
554
+
```json
555
+
{
556
+
"schema_version": 1,
557
+
"defaults": {
558
+
"deployment_config": {
559
+
"bin_dir": "/path/to/bin/",
560
+
"ready_recovery_action": {
561
+
"restart": {
562
+
"number_of_attempts": 3,
563
+
"delay_before_restart": 0.5
564
+
}
565
+
},
566
+
"sandbox": {
567
+
"uid": 0,
568
+
"gid": 0,
569
+
"scheduling_policy": "SCHED_OTHER",
570
+
"scheduling_priority": 1
571
+
}
572
+
},
573
+
"component_properties": {
574
+
"application_profile": {
575
+
"application_type": "Reporting",
576
+
"alive_supervision": {
577
+
"reporting_cycle": 0.1,
578
+
"min_indications": 1,
579
+
"max_indications": 3,
580
+
"failed_cycles_tolerance": 2
581
+
}
582
+
}
583
+
}
584
+
},
585
+
"components": {
586
+
"my_app": {
587
+
"component_properties": {
588
+
"binary_name": "my_app_binary",
589
+
"application_profile": {
590
+
"application_type": "Reporting"
591
+
}
592
+
}
593
+
}
594
+
},
595
+
"run_targets": {
596
+
"startup": {
597
+
"description": "System startup",
598
+
"depends_on": ["my_app"]
599
+
}
600
+
},
601
+
"initial_run_target": "startup"
602
+
}
603
+
505
604
## Dependencies
506
605
507
606
### Rust
@@ -519,81 +618,53 @@ The Python test files build appropriate configurations for each scenario automat
519
618
520
619
### Python
521
620
522
-
-`pytest` — Test framework and orchestration
523
621
- `testing_utils` — Log parsing and scenario execution utilities
524
622
525
623
## Future Enhancements
526
624
527
625
Potential areas for expansion:
528
626
529
-
1.**Integration with Real Launch Manager**:
530
-
- Tests that run against actual Launch Manager daemon
531
-
- Validation of supervision and recovery behavior
532
-
- End-to-end lifecycle state transitions
627
+
1. **Enhanced Daemon Integration**:
628
+
- ✅ Basic daemon fixture and test infrastructure
629
+
- ✅ Supervised application launching tests
630
+
- ⏳ Dynamic configuration updates via control interface
The test suite implements several design patterns worth noting:
562
-
563
-
1. Dual language implementation (Rust and C++) ensures API parity across both ecosystems
564
-
2. Uses actual lifecycle and health monitoring APIs from `@score_lifecycle_health` rather than mocks
565
-
3. Three-layer architecture separates Python orchestration from Rust/C++ implementation
566
-
4. Tests function without requiring a running Launch Manager daemon (graceful degradation)
567
-
5. Structured logging differs by language: JSON via `tracing` for Rust, plain text for C++
568
-
569
-
### Technical Observations
570
-
571
-
**API Integration Approach:**
572
-
573
-
The tests validate API signatures and integration patterns rather than end-to-end daemon behavior. When no daemon is present, lifecycle client calls return empty results (C++) or `false` (Rust) without panicking. This allows tests to verify that application code correctly uses the lifecycle APIs.
574
-
575
-
**OCI Compliance Coverage:**
576
-
577
-
Requirement `feat_req__lifecycle__oci_compliant` (OCI Specification v1.2.0) is tested through `test_configuration_management.py` via the `runtime_config_compat` test. This test validates runtime configuration compliance with OCI standards. Additional documentation could clarify the specific OCI v1.2.0 features validated.
578
-
579
-
### Potential Enhancements
580
-
581
-
1.**Requirement Traceability**: Adding requirement IDs as pytest markers would enable automated coverage reporting:
2.**Coverage Automation**: Generate machine-readable coverage reports linking tests to requirements for CI/CD integration
590
-
591
-
3.**Daemon Integration**: The current approach focuses on API integration. Future work could add tests against a running Launch Manager daemon to validate supervision, recovery, and state management behavior
592
-
593
-
4.**OCI Compliance Documentation**: Explicitly document which OCI v1.2.0 specification sections are validated by `runtime_config_compat`
594
-
595
-
## Summary
596
-
597
-
This test suite covers 85 of 92 lifecycle requirements (92% coverage) and validates API integration patterns for both Rust and C++ implementations. The tests verify that applications can correctly call lifecycle management APIs and integrate with the S-CORE lifecycle framework. The test architecture enables running without a daemon, making tests suitable for CI environments where full daemon infrastructure may not be available.
598
-
599
668
---
669
+
670
+
**Summary**: This test suite covers 85 of 92 lifecycle requirements (92% coverage) and validates API integration patterns for both Rust and C++ implementations. Tests run with Bazel for both API integration mode (fast CI feedback) and daemon integration mode (comprehensive end-to-end validation). The dual-language implementation ensures both ecosystems have equal support and validates that lifecycle APIs work correctly across languages.
0 commit comments