Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CU/10055-rachael-detox-add-failed-outside-detox-test-to-testRail #10060

Open
wants to merge 76 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
7d25719
CU/10055-rachael-detox-add-failed-outside-detox-test-to-testRail
rbontrager Oct 29, 2024
b4c30c8
Update e2e_android.yml
rbontrager Oct 29, 2024
9e1260f
Update e2e_android.yml
rbontrager Oct 29, 2024
9008a8b
Update e2e_android.yml
rbontrager Oct 29, 2024
40393a5
Update e2e_android.yml
rbontrager Oct 29, 2024
b5b8db1
Update e2e_android.yml
rbontrager Oct 29, 2024
71cdc25
Update e2e_android.yml
rbontrager Oct 30, 2024
031adf2
Update e2e_android.yml
rbontrager Oct 30, 2024
9a68b16
Update e2e_android.yml
rbontrager Oct 30, 2024
038b865
Update e2e_android.yml
rbontrager Oct 30, 2024
9dfb912
Update e2e_android.yml
rbontrager Oct 30, 2024
00cad73
Update e2e_android.yml
rbontrager Oct 30, 2024
700fd51
Update e2e_android.yml
rbontrager Oct 30, 2024
d6cd815
Update e2e_android.yml
rbontrager Oct 30, 2024
f9c94bd
Update e2e_android.yml
rbontrager Oct 30, 2024
ec283ea
Update e2e_android.yml
rbontrager Oct 30, 2024
1e999fc
Update e2e_android.yml
rbontrager Oct 30, 2024
920649c
Update e2e_android.yml
rbontrager Oct 30, 2024
25129ac
Update e2e_android.yml
rbontrager Oct 30, 2024
85c0551
Update e2e_android.yml
rbontrager Oct 30, 2024
f8a22a7
Update e2e_android.yml
rbontrager Oct 30, 2024
8e43977
Update e2e_android.yml
rbontrager Oct 30, 2024
ee37453
Update e2e_android.yml
rbontrager Oct 31, 2024
c176d01
Update e2e_android.yml
rbontrager Oct 31, 2024
e62150b
Update e2e_android.yml
rbontrager Oct 31, 2024
3c4d3ae
Update e2e names to match file names
rbontrager Oct 31, 2024
6b6d2bc
Update e2e_android.yml
rbontrager Oct 31, 2024
64c17f8
Put screen names back
rbontrager Oct 31, 2024
dc72086
Update e2e_android.yml
rbontrager Nov 1, 2024
bffe101
Update e2e_android.yml
rbontrager Nov 1, 2024
0624424
Update update_testrail_results.yml
rbontrager Nov 1, 2024
c66b459
Update e2e_android.yml
rbontrager Nov 1, 2024
42f46b0
Add changes to e2e_ios
rbontrager Nov 1, 2024
d29bf7e
Merge branch 'develop' into CU/10055-rachael-detox-add-failed-outside…
TKDickson Nov 14, 2024
9ad8043
Update e2e_android.yml
rbontrager Nov 20, 2024
55cf4ef
Update e2e_android.yml
rbontrager Nov 20, 2024
4c853d3
Update e2e_android.yml
rbontrager Nov 20, 2024
f86ec79
Update e2e_android.yml
rbontrager Nov 20, 2024
3eb7470
Update e2e_android.yml
rbontrager Nov 20, 2024
cda1742
Update e2e_android.yml
rbontrager Nov 20, 2024
f5d992b
Update e2e_android.yml
rbontrager Nov 20, 2024
26d8a81
Update e2e_android.yml
rbontrager Nov 20, 2024
bca1fe3
Update e2e_android.yml
rbontrager Nov 20, 2024
add2415
Update e2e_android.yml
rbontrager Nov 20, 2024
d7d40bd
Update e2e_android.yml
rbontrager Nov 20, 2024
199f25d
Update e2e_android.yml
rbontrager Nov 20, 2024
46976a4
Update e2e_android.yml
rbontrager Nov 20, 2024
1642696
Update e2e_android.yml
rbontrager Nov 20, 2024
41321e3
Update e2e_android.yml
rbontrager Nov 20, 2024
3ea009e
Update e2e_android.yml
rbontrager Nov 20, 2024
c5a52d9
Update e2e_android.yml
rbontrager Nov 20, 2024
e36ff21
Update e2e_android.yml
rbontrager Nov 20, 2024
d969a8e
Update e2e_android.yml
rbontrager Nov 20, 2024
e4a21b8
Update e2e_android.yml
rbontrager Nov 20, 2024
9823502
Update e2e_android.yml
rbontrager Nov 20, 2024
18e1e85
Update e2e_android.yml
rbontrager Nov 20, 2024
0ebc6c6
Update e2e_android.yml
rbontrager Nov 21, 2024
c478d45
Update e2e_android.yml
rbontrager Nov 21, 2024
1ff1252
Update e2e_android.yml
rbontrager Nov 21, 2024
75f6487
Update e2e_android.yml
rbontrager Nov 21, 2024
4eaac6c
Update e2e_android.yml
rbontrager Nov 21, 2024
bf876d1
Update e2e_android.yml
rbontrager Nov 21, 2024
7233e3c
Update e2e_android.yml
rbontrager Nov 21, 2024
3002b2e
Update e2e_android.yml
rbontrager Nov 21, 2024
b37f926
Update e2e_android.yml
rbontrager Nov 21, 2024
278d30d
Update e2e_android.yml
rbontrager Nov 21, 2024
ffb9be9
Update e2e_android.yml
rbontrager Nov 21, 2024
49e09f4
Update e2e_android.yml
rbontrager Nov 21, 2024
f51b1a6
Update e2e_android.yml
rbontrager Nov 21, 2024
fae6625
Add logic to e2e_ios
rbontrager Nov 21, 2024
4d5a4c6
Update e2e_android.yml
rbontrager Nov 21, 2024
de343f1
Stop android error, update iOS logic
rbontrager Nov 21, 2024
02d17e4
Update e2e_ios.yml
rbontrager Nov 21, 2024
be6f2b2
Update e2e_ios.yml
rbontrager Nov 21, 2024
d1418e0
Account for AppointmentsExpanded Name Change in testRail
rbontrager Nov 22, 2024
3efe1fa
Merge branch 'develop' into CU/10055-rachael-detox-add-failed-outside…
TKDickson Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 104 additions & 2 deletions .github/workflows/e2e_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jobs:
outputs:
output1: ${{ steps.matrix_value.outputs.matrix }}
output2: ${{ steps.matrix_value.outputs.individual_matrix}}
output3: ${{ steps.matrix_value.outputs.testRail_matrix}}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -105,10 +106,14 @@ jobs:
if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then
e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]')
echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT"
testRail=$(echo $e2eNames | tr ',' ' ')
testRail=$(echo $testRail | sed 's/\S*\(.e2e.ts\)\S*//g')
echo "testRail_matrix=$testRail" >> "$GITHUB_OUTPUT"
echo "individual_matrix=" >> "$GITHUB_OUTPUT"
else
if [[ "${{ inputs.tests_to_run}}" != "" ]]; then
echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT"
echo "testRail_matrix=${{ inputs.tests_to_run}}" >> "$GITHUB_OUTPUT"
echo "individual_matrix=true" >> "$GITHUB_OUTPUT"
else
echo "matrix=" >> "$GITHUB_OUTPUT"
Expand All @@ -121,13 +126,18 @@ jobs:
if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then
e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]')
echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT"
testRail=$(echo $e2eNames | tr ',' ' ')
testRail=$(echo $testRail | sed 's/\S*\(.e2e.ts\)\S*//g')
echo "testRail_matrix=$testRail" >> "$GITHUB_OUTPUT"
echo "individual_matrix=" >> "$GITHUB_OUTPUT"
else
if [[ "${{ inputs.tests_to_run}}" != "" ]]; then
echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT"
echo "testRail_matrix=${{ inputs.tests_to_run}}" >> "$GITHUB_OUTPUT"
echo "individual_matrix=true" >> "$GITHUB_OUTPUT"
else
echo "matrix=" >> "$GITHUB_OUTPUT"
echo "testRail_matrix=" >> "$GITHUB_OUTPUT"
fi
fi
else
Expand Down Expand Up @@ -369,6 +379,7 @@ jobs:
uses: actions/checkout@v3
- name: update-test-names
run: |
echo "" >> input.json
for ((i=0; ; i+=250)); do
echo "i = $i"
getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \
Expand All @@ -380,12 +391,98 @@ jobs:
break
fi
done
getTest=$(curl -X GET -H 'Content-Type: application/json' \
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
"https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29&section_id=9683" | jq .cases[])
getTestCaseNewName=$(jq --compact-output -s 'add' input.json)
groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]')
getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]')
for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do
missingCases=""
echo "$y"
removeBracket=$(echo $y | tr -d '[')
removeBracket=$(echo $removeBracket | tr -d ']')
removeBracket=$(echo $removeBracket | tr -d ',')
addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g')

if [[ "$removeBracket" == "Appointments" ]]; then
title="$removeBracket Screen [android]"
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")')
echo "$missingCases"
elif [[ "$removeBracket" == "AppointmentsExpanded" ]]; then
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "Appointments Screen Expansion [android]" '.[] | select(contains($testsTypedIn))')
elif [[ "$removeBracket" == "Appeals" ]]; then
title="$removeBracket [android]"
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")')
elif [[ "$removeBracket" == "VALetters" ]]; then
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters [android]" '.[] | select(contains($testsTypedIn))')
else
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn) and contains("[android]"))')
fi

if [[ "$missingCases" == "" ]]; then
if [[ "$removeBracket" == "Appointments" ]]; then
title="$removeBracket Screen [android]"
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")')
elif [[ "$removeBracket" == "AppointmentsExpanded" ]]; then
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == ":ios: Appointments Screen Expansion [android]")')
elif [[ "$removeBracket" == "VALetters" ]]; then
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [android]")')
elif [[ "$removeBracket" == "Appeals" ]]; then
title="$removeBracket [android]"
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")')
else
matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[android]"))')
fi
echo "" >> input.json
echo "$matchMissingCases"
if [[ "$matchMissingCases" != "" ]]; then
addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]')
echo $addMissingCasesToArray >> input.json
continue
fi
else
continue
fi

missingCases=""
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn) and contains("[android]"))')
if [[ "$missingCases" == "" ]]; then
title="$addSpace [android]"
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")')
echo "$matchMissingCases"
if [[ "$matchMissingCases" != "" ]]; then
addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]')
echo $addMissingCasesToArray >> input.json
continue
fi
else
continue
fi

for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do
missingCases=""
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" '.[] | select(contains($testsTypedIn))')
if [[ "$missingCases" == "" ]]; then
echo "$z"
matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))')
if [[ "$matchMissingCases" != "" ]]; then
echo "$matchMissingCases"
addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]')
echo $addMissingCasesToArray >> input.json
break
fi
else
break
fi
done
done
getTestCaseNewName=$(jq --compact-output -s 'add' input.json)
groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]')
getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]')
getCasesID=$(curl -X GET -H 'Content-Type: application/json' \
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
"https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29")
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
"https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29")
updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
-d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \
Expand Down Expand Up @@ -417,5 +514,10 @@ jobs:
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
-d '{"status_id": 1}' \
"https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"")
else
resp5=$(curl -X POST -H 'Content-Type: application/json' \
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
-d '{"status_id": 4, "comment": "Something failed in github actions outside of the e2e tests. Please try again."}' \
"https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"")
fi
done
105 changes: 103 additions & 2 deletions .github/workflows/e2e_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ jobs:
outputs:
output1: ${{ steps.matrix_value.outputs.matrix }}
output2: ${{ steps.matrix_value.outputs.individual_matrix}}
output3: ${{ steps.matrix_value.outputs.testRail_matrix}}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -96,10 +97,14 @@ jobs:
if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then
e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]')
echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT"
testRail=$(echo $e2eNames | tr ',' ' ')
testRail=$(echo $testRail | sed 's/\S*\(.e2e.ts\)\S*//g')
echo "testRail_matrix=$testRail" >> "$GITHUB_OUTPUT"
echo "individual_matrix=" >> "$GITHUB_OUTPUT"
else
if [[ "${{ inputs.tests_to_run}}" != "" ]]; then
echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT"
echo "testRail_matrix=${{ inputs.tests_to_run}}" >> "$GITHUB_OUTPUT"
echo "individual_matrix=true" >> "$GITHUB_OUTPUT"
else
echo "matrix=" >> "$GITHUB_OUTPUT"
Expand All @@ -112,10 +117,14 @@ jobs:
if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then
e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]')
echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT"
testRail=$(echo $e2eNames | tr ',' ' ')
testRail=$(echo $testRail | sed 's/\S*\(.e2e.ts\)\S*//g')
echo "testRail_matrix=$testRail" >> "$GITHUB_OUTPUT"
echo "individual_matrix=" >> "$GITHUB_OUTPUT"
else
if [[ "${{ inputs.tests_to_run}}" != "" ]]; then
echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT"
echo "testRail_matrix=${{ inputs.tests_to_run}}" >> "$GITHUB_OUTPUT"
echo "individual_matrix=true" >> "$GITHUB_OUTPUT"
else
echo "matrix=" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -347,6 +356,7 @@ jobs:
uses: actions/checkout@v3
- name: update-test-names
run: |
echo "" >> input.json
for ((i=0; ; i+=250)); do
echo "i = $i"
getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \
Expand All @@ -358,12 +368,98 @@ jobs:
break
fi
done
getTest=$(curl -X GET -H 'Content-Type: application/json' \
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
"https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29&section_id=9683" | jq .cases[])
getTestCaseNewName=$(jq --compact-output -s 'add' input.json)
groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]')
getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]')
for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do
missingCases=""
echo "$y"
removeBracket=$(echo $y | tr -d '[')
removeBracket=$(echo $removeBracket | tr -d ']')
removeBracket=$(echo $removeBracket | tr -d ',')
addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g')

if [[ "$removeBracket" == "Appointments" ]]; then
title="$removeBracket Screen [ios]"
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")')
echo "$missingCases"
elif [[ "$removeBracket" == "AppointmentsExpanded" ]]; then
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "Appointments Screen Expansion [ios]" '.[] | select(contains($testsTypedIn))')
elif [[ "$removeBracket" == "Appeals" ]]; then
title="$removeBracket [ios]"
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")')
elif [[ "$removeBracket" == "VALetters" ]]; then
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters [ios]" '.[] | select(contains($testsTypedIn))')
else
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn) and contains("[ios]"))')
fi

if [[ "$missingCases" == "" ]]; then
if [[ "$removeBracket" == "Appointments" ]]; then
title="$removeBracket Screen [ios]"
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")')
elif [[ "$removeBracket" == "AppointmentsExpanded" ]]; then
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == ":ios: Appointments Screen Expansion [ios]")')
elif [[ "$removeBracket" == "VALetters" ]]; then
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [ios]")')
elif [[ "$removeBracket" == "Appeals" ]]; then
title="$removeBracket [ios]"
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")')
else
matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))')
fi
echo "" >> input.json
echo "$matchMissingCases"
if [[ "$matchMissingCases" != "" ]]; then
addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]')
echo $addMissingCasesToArray >> input.json
continue
fi
else
continue
fi

missingCases=""
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn) and contains("[ios]"))')
if [[ "$missingCases" == "" ]]; then
title="$addSpace [ios]"
matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")')
echo "$matchMissingCases"
if [[ "$matchMissingCases" != "" ]]; then
addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]')
echo $addMissingCasesToArray >> input.json
continue
fi
else
continue
fi

for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do
missingCases=""
missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" '.[] | select(contains($testsTypedIn))')
if [[ "$missingCases" == "" ]]; then
echo "$z"
matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))')
if [[ "$matchMissingCases" != "" ]]; then
echo "$matchMissingCases"
addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]')
echo $addMissingCasesToArray >> input.json
break
fi
else
break
fi
done
done
getTestCaseNewName=$(jq --compact-output -s 'add' input.json)
groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]')
getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]')
getCasesID=$(curl -X GET -H 'Content-Type: application/json' \
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
"https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29")
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
"https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29")
updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
-d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \
Expand Down Expand Up @@ -395,5 +491,10 @@ jobs:
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
-d '{"status_id": 1}' \
"https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"")
else
resp5=$(curl -X POST -H 'Content-Type: application/json' \
-u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \
-d '{"status_id": 4, "comment": "Something failed in github actions outside of the e2e tests. Please try again."}' \
"https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"")
fi
done
Loading
Loading