@@ -23,15 +23,29 @@ jobs:
2323 - name : Discover testcases
2424 id : discover
2525 run : |
26- # Find all testcase folders (excluding common folders like README, etc.)
27- testcase_dirs=$(find packages/uipath-llamaindex/testcases -maxdepth 1 -type d -name "*-*" | sed 's|packages/uipath-llamaindex/testcases/||' | sort)
26+ # Find all packages with testcases directories
27+ testcases_array="[]"
2828
29- echo "Found testcase directories:"
30- echo "$testcase_dirs"
29+ for package_dir in packages/*/testcases; do
30+ if [ -d "$package_dir" ]; then
31+ package_name=$(echo "$package_dir" | sed 's|packages/\(.*\)/testcases|\1|')
32+ echo "Discovering testcases in $package_name"
3133
32- # Convert to JSON array for matrix
33- testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]')
34- echo "testcases=$testcases_json" >> $GITHUB_OUTPUT
34+ # Find all testcase folders in this package
35+ for testcase_dir in "$package_dir"/*-*; do
36+ if [ -d "$testcase_dir" ]; then
37+ testcase_name=$(basename "$testcase_dir")
38+ echo " Found: $testcase_name"
39+
40+ # Add to JSON array with package and testcase info
41+ testcases_array=$(echo "$testcases_array" | jq -c ". += [{\"package\": \"$package_name\", \"testcase\": \"$testcase_name\"}]")
42+ fi
43+ done
44+ fi
45+ done
46+
47+ echo "Testcases matrix: $testcases_array"
48+ echo "testcases=$testcases_array" >> $GITHUB_OUTPUT
3549
3650 integration-tests :
3751 needs : [discover-testcases]
@@ -44,10 +58,10 @@ jobs:
4458 strategy :
4559 fail-fast : false
4660 matrix :
47- testcase : ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
61+ testcase-info : ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
4862 environment : [alpha, cloud, staging]
4963
50- name : " ${{ matrix.testcase }} / ${{ matrix.environment }}"
64+ name : " ${{ matrix.testcase-info.package }}/${{ matrix.testcase-info.testcase }} / ${{ matrix.environment }}"
5165
5266 steps :
5367 - name : Checkout code
6175 CLIENT_ID : ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_ID || matrix.environment == 'staging' && secrets.STAGING_TEST_CLIENT_ID || matrix.environment == 'cloud' && secrets.CLOUD_TEST_CLIENT_ID }}
6276 CLIENT_SECRET : ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_SECRET || matrix.environment == 'staging' && secrets.STAGING_TEST_CLIENT_SECRET || matrix.environment == 'cloud' && secrets.CLOUD_TEST_CLIENT_SECRET }}
6377 BASE_URL : ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || matrix.environment == 'staging' && secrets.STAGING_BASE_URL || matrix.environment == 'cloud' && secrets.CLOUD_BASE_URL }}
64- working-directory : packages/uipath-llamaindex /testcases/${{ matrix.testcase }}
78+ working-directory : packages/${{ matrix.testcase-info.package }} /testcases/${{ matrix.testcase-info .testcase }}
6579 run : |
66- echo "Running testcase: ${{ matrix.testcase }}"
80+ echo "Running testcase: ${{ matrix.testcase-info.testcase }}"
81+ echo "Package: ${{ matrix.testcase-info.package }}"
6782 echo "Environment: ${{ matrix.environment }}"
6883 echo "Working directory: $(pwd)"
6984
0 commit comments