Skip to content

Commit

Permalink
add failure missing test samples
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunyez committed Oct 26, 2023
1 parent c64b213 commit 11e31a4
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vse_sync_pp/analyzers/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def test(self, data):
return (False, "short test duration")
if len(data) - 1 < self._duration_min:
return (False, "short test samples")
if len(data.timestamp.diff().astype(float).round(0).tail(-1).unique()) > 1:
return (False, "missing test samples")
return (True, None)

def explain(self, data):
Expand Down
32 changes: 32 additions & 0 deletions tests/vse_sync_pp/analyzers/test_gnss.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,38 @@ class TestTimeErrorAnalyzer(TestCase, metaclass=AnalyzerTestBuilder):
},
},
},
{
'requirements': 'G.8272/PRTC-A',
'parameters': {
'time-error-limit/%': 100,
'transient-period/s': 1,
'min-test-duration/s': 4,
},
'rows': (
TERR(Decimal(0), 0, 5),
TERR(Decimal(1), 0, 5),
TERR(Decimal(2), 0, 5),
TERR(Decimal(3), 0, 5),
# oops, missing sample
TERR(Decimal(5), 0, 5),
TERR(Decimal(6), 0, 5),
),
'result': False,
'reason': "missing test samples",
'timestamp': Decimal(1),
'duration': Decimal(5),
'analysis': {
'terror': {
'units': 'ns',
'min': 0,
'max': 0,
'range': 0,
'mean': 0,
'stddev': 0,
'variance': 0,
},
},
},
{
'requirements': 'G.8272/PRTC-A',
'parameters': {
Expand Down
32 changes: 32 additions & 0 deletions tests/vse_sync_pp/analyzers/test_phc2sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,38 @@ class TestTimeErrorAnalyzer(TestCase, metaclass=AnalyzerTestBuilder):
},
},
},
{
'requirements': 'workload/RAN',
'parameters': {
'time-error-limit/%': 100,
'transient-period/s': 1,
'min-test-duration/s': 4,
},
'rows': (
TERR(Decimal(0), 0, 's2', 620),
TERR(Decimal(1), 0, 's2', 620),
TERR(Decimal(2), 0, 's2', 620),
TERR(Decimal(3), 0, 's2', 620),
# oops, missing sample
TERR(Decimal(5), 0, 's2', 620),
TERR(Decimal(6), 0, 's2', 620),
),
'result': False,
'reason': "missing test samples",
'timestamp': Decimal(1),
'duration': Decimal(5),
'analysis': {
'terror': {
'units': 'ns',
'min': 0,
'max': 0,
'range': 0,
'mean': 0,
'stddev': 0,
'variance': 0,
},
},
},
{
'requirements': 'workload/RAN',
'parameters': {
Expand Down
31 changes: 31 additions & 0 deletions tests/vse_sync_pp/analyzers/test_ppsdpll.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,37 @@ class TestTimeErrorAnalyzer(TestCase, metaclass=AnalyzerTestBuilder):
},
},
},
{
'requirements': 'G.8272/PRTC-B',
'parameters': {
'time-error-limit/%': 100,
'transient-period/s': 1,
'min-test-duration/s': 3,
},
'rows': (
DPLLS(Decimal('1876878.28'), 3, 3, Decimal(1)),
DPLLS(Decimal('1876879.28'), 3, 3, Decimal(1)),
# oops, lost sample
DPLLS(Decimal('1876881.28'), 3, 3, Decimal(1)),
DPLLS(Decimal('1876882.28'), 3, 3, Decimal(1)),
DPLLS(Decimal('1876883.28'), 3, 3, Decimal(1)),
),
'result': False,
'reason': "missing test samples",
'timestamp': Decimal('1876879.28'),
'duration': Decimal(4),
'analysis': {
'terror': {
'units': 'ns',
'min': 1,
'max': 1,
'range': 0,
'mean': 1,
'stddev': 0,
'variance': 0,
},
},
},
{
'requirements': 'G.8272/PRTC-B',
'parameters': {
Expand Down
32 changes: 32 additions & 0 deletions tests/vse_sync_pp/analyzers/test_ts2phc.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,38 @@ class TestTimeErrorAnalyzer(TestCase, metaclass=AnalyzerTestBuilder):
},
},
},
{
'requirements': 'G.8272/PRTC-A',
'parameters': {
'time-error-limit/%': 100,
'transient-period/s': 1,
'min-test-duration/s': 4,
},
'rows': (
TERR(Decimal(0), 0, 's2'),
TERR(Decimal(1), 0, 's2'),
TERR(Decimal(2), 0, 's2'),
TERR(Decimal(3), 0, 's2'),
# oops, missing sample
TERR(Decimal(5), 0, 's2'),
TERR(Decimal(6), 0, 's2'),
),
'result': False,
'reason': "missing test samples",
'timestamp': Decimal(1),
'duration': Decimal(5),
'analysis': {
'terror': {
'units': 'ns',
'min': 0,
'max': 0,
'range': 0,
'mean': 0,
'stddev': 0,
'variance': 0,
},
},
},
{
'requirements': 'G.8272/PRTC-A',
'parameters': {
Expand Down

0 comments on commit 11e31a4

Please sign in to comment.