Committed by
GitHub
Fix iOS integration tests (#165)
* Replace instruments with xtrace * Use `list devices` * Include workflow file in paths * Update devices * Update awk command * Use gawk for separation * Debug * Install gawk
Showing
1 changed file
with
11 additions
and
8 deletions
| @@ -13,6 +13,7 @@ on: | @@ -13,6 +13,7 @@ on: | ||
| 13 | - '**/test_driver/**' | 13 | - '**/test_driver/**' |
| 14 | - '**/assets/**' | 14 | - '**/assets/**' |
| 15 | - '**/integration_test/**' | 15 | - '**/integration_test/**' |
| 16 | + - '.github/workflows/checks.yml' | ||
| 16 | 17 | ||
| 17 | jobs: | 18 | jobs: |
| 18 | analyze: | 19 | analyze: |
| @@ -48,11 +49,12 @@ jobs: | @@ -48,11 +49,12 @@ jobs: | ||
| 48 | test: | 49 | test: |
| 49 | timeout-minutes: 16 | 50 | timeout-minutes: 16 |
| 50 | runs-on: macos-latest | 51 | runs-on: macos-latest |
| 51 | - name: ${{ matrix.package }} testing on ${{ matrix.channel }} | 52 | + name: ${{ matrix.package }} testing on ${{ matrix.channel }} with ${{ matrix.device }} |
| 52 | strategy: | 53 | strategy: |
| 53 | matrix: | 54 | matrix: |
| 54 | device: | 55 | device: |
| 55 | - - 'iPhone 12 Pro Max (14.4)' | 56 | + - 'iPhone 12 Pro Simulator (15.0)' |
| 57 | + - 'iPhone 13 Pro Max Simulator (15.0)' | ||
| 56 | channel: | 58 | channel: |
| 57 | - 'stable' | 59 | - 'stable' |
| 58 | - 'beta' | 60 | - 'beta' |
| @@ -68,14 +70,15 @@ jobs: | @@ -68,14 +70,15 @@ jobs: | ||
| 68 | steps: | 70 | steps: |
| 69 | - name: Start iOS simulator | 71 | - name: Start iOS simulator |
| 70 | if: matrix.package == 'wakelock' | 72 | if: matrix.package == 'wakelock' |
| 73 | + # Using gawk to be able to use my regex to separate the IDs from the device names | ||
| 74 | + # (because my awk skills suck) to then pipe that to awk to find the right device. | ||
| 71 | run: | | 75 | run: | |
| 72 | - xcrun instruments -s | 76 | + brew install gawk |
| 77 | + xcrun xctrace list devices | ||
| 73 | UDID=$( | 78 | UDID=$( |
| 74 | - xcrun instruments -s | | ||
| 75 | - awk \ | ||
| 76 | - -F ' *[][]' \ | ||
| 77 | - -v 'device=${{ matrix.device }}' \ | ||
| 78 | - '$1 == device { print $2 }' | 79 | + xcrun xctrace list devices | |
| 80 | + gawk 'match($0, /(.+) \(([^.]*)\)/, a) { printf "%s,%s\n", a[1], a[2] }' | | ||
| 81 | + awk -F ',' -v 'device=${{ matrix.device }}' '$1 == device { print $2 }' | ||
| 79 | ) | 82 | ) |
| 80 | xcrun simctl boot "${UDID:?simulator not found}" | 83 | xcrun simctl boot "${UDID:?simulator not found}" |
| 81 | - uses: actions/checkout@v2.3.3 | 84 | - uses: actions/checkout@v2.3.3 |
-
Please register or login to post a comment