Skip to content

Commit

Permalink
Ensure Test Data Exists
Browse files Browse the repository at this point in the history
Move data creation of data for perf tests into perf test suite where it belongs
  • Loading branch information
damies13 committed Mar 23, 2024
1 parent a1bbc63 commit 7c217ea
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 21 deletions.
16 changes: 0 additions & 16 deletions Regression_Tests/TestDataTable-API_requests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -349,22 +349,6 @@ Create Demo Data
${resp}= PUT On Session TDT /Demo 2/Demo 3/data value 1 expected_status=201
Should Be Equal As Strings ${resp.status_code} 201

Prep for Perf Tests
${Table}= Set Variable TT20
${Col 1}= Set Variable GC_20k
${Col 2}= Set Variable BNE_20k
${filedata}= Get File ${CURDIR}${/}testdata${/}${Col 1}.csv
@{filelines}= Split To Lines ${filedata}
FOR ${line} IN @{filelines}
# ${resp}= POST On Session TDT /${Table}/row {"${Col 1}":"${line}"} expected_status=201
${resp}= PUT On Session TDT /${Table}/${Col 1}/${line} expected_status=201
END
${filedata}= Get File ${CURDIR}${/}testdata${/}${Col 2}.csv
@{filelines}= Split To Lines ${filedata}
FOR ${line} IN @{filelines}
# ${resp}= POST On Session TDT /${Table}/row {"${Col 1}":"${line}"} expected_status=201
${resp}= PUT On Session TDT /${Table}/${Col 2}/${line} expected_status=201
END

*** Keywords ***
Connect to TDT
Expand Down
40 changes: 35 additions & 5 deletions Regression_Tests/TestDataTable-API_requests_perf.robot
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
*** Settings ***
Resource environment.robot

Library Collections
Library JsonValidator
Library RequestsLibrary
Library String
Library Collections
Library JsonValidator
Library RequestsLibrary
Library String

Suite Setup Connect to TDT
Suite Setup Ensure Test Data Exists

Default Tags API RequestsLibrary

Expand Down Expand Up @@ -94,6 +94,36 @@ Connect to TDT
Create Session TDT http://${TDT_Host}
Log Connect to TDT:http://${TDT_Host}

Ensure Test Data Exists
Connect to TDT

${resp}= GET On Session TDT /${Table}/${Col 1}/all
Log ${resp.json()}
@{coldata}= Set Variable ${resp.json()['${Col 1}']}
${len}= Get Length ${coldata}
IF ${len} < 1000
${filedata}= Get File ${CURDIR}${/}testdata${/}${Col 1}.csv
@{filelines}= Split To Lines ${filedata}
FOR ${line} IN @{filelines}
# ${resp}= POST On Session TDT /${Table}/row {"${Col 1}":"${line}"} expected_status=201
${resp}= PUT On Session TDT /${Table}/${Col 1}/${line} expected_status=201
END
END

${resp}= GET On Session TDT /${Table}/${Col 2}/all
@{coldata}= Set Variable ${resp.json()['${Col 2}']}
${len}= Get Length ${coldata}
IF ${len} < 1000
${filedata}= Get File ${CURDIR}${/}testdata${/}${Col 2}.csv
@{filelines}= Split To Lines ${filedata}
FOR ${line} IN @{filelines}
# ${resp}= POST On Session TDT /${Table}/row {"${Col 1}":"${line}"} expected_status=201
${resp}= PUT On Session TDT /${Table}/${Col 2}/${line} expected_status=201
END
END



Get TDT Value
[Arguments] ${table} ${column}
[Documentation] Get TDT Value /${table}/${column}
Expand Down

0 comments on commit 7c217ea

Please sign in to comment.