Skip to content

Commit

Permalink
refactor(app): add RTP properties to protocol run event analytics (#1…
Browse files Browse the repository at this point in the history
…4836)

* refactor(app): add RTP properties to protocol run event analytics
  • Loading branch information
ncdiehl11 committed Apr 24, 2024
1 parent 5f85719 commit 77bc720
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ const MODULES = {
module1: { model: 'module1' },
module2: { model: 'module2' },
}
const RUNTIME_PARAMETERS = [
{
displayName: 'test param',
variableName: 'test_param',
description: 'Mock boolean parameter',
type: 'bool',
default: true,
value: true,
},
]
const FORMATTED_MODULES = 'module1,module2'
const STORED_PROTOCOL_ANALYSIS = {
config: { protocolType: 'json', schemaVersion: 1.11 },
Expand All @@ -49,11 +59,13 @@ const STORED_PROTOCOL_ANALYSIS = {
robotType: 'OT-2 Standard',
pipettes: PIPETTES,
modules: MODULES,
runTimeParameters: RUNTIME_PARAMETERS,
}
const ROBOT_PROTOCOL_ANALYSIS = {
robotType: 'OT-2 Standard',
pipettes: PIPETTES,
modules: MODULES,
runTimeParameters: RUNTIME_PARAMETERS,
}

describe('useProtocolAnalysisErrors hook', () => {
Expand Down Expand Up @@ -126,6 +138,8 @@ describe('useProtocolAnalysisErrors hook', () => {
protocolAppName: 'Python API',
protocolAppVersion: 2.3,
protocolAuthor: 'hashedString',
protocolHasRunTimeParameterCustomValues: false,
protocolHasRunTimeParameters: true,
protocolName: 'robot protocol',
protocolSource: 'robot protocol source',
protocolText: 'hashedString',
Expand Down Expand Up @@ -156,6 +170,8 @@ describe('useProtocolAnalysisErrors hook', () => {
protocolAppVersion: '1.1',
protocolAuthor: 'hashedString',
protocolName: 'stored protocol',
protocolHasRunTimeParameterCustomValues: false,
protocolHasRunTimeParameters: true,
protocolSource: 'stored protocol source',
protocolText: 'hashedString',
protocolType: 'json',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ export const parseProtocolRunAnalyticsData = (
.join(','),
protocolAuthor: protocolAuthor !== '' ? protocolAuthor : '',
protocolText: protocolText !== '' ? protocolText : '',
protocolHasRunTimeParameters:
protocolAnalysis?.runTimeParameters != null
? protocolAnalysis?.runTimeParameters?.length > 0
: false,
protocolHasRunTimeParameterCustomValues:
protocolAnalysis?.runTimeParameters?.some(
param => param.value !== param.default
) ?? false,
robotType:
protocolAnalysis?.robotType != null
? protocolAnalysis?.robotType
Expand Down

0 comments on commit 77bc720

Please sign in to comment.