From 7ce6d4ad4e70d0f90e5b9563d42838585b624822 Mon Sep 17 00:00:00 2001 From: Semir Date: Wed, 15 May 2024 15:34:38 +0200 Subject: [PATCH 01/42] ci: collect coverage from TS files and upload to Sonar --- .github/actions/sonar/actions.yml | 47 +++ .github/workflows/run-tests.yml | 39 -- .../workflows/unit-tests-and-code-quality.yml | 50 +++ .gitignore | 7 +- package.json | 3 +- packages/sdk/android/build.gradle | 2 + packages/sdk/jest.config.js | 9 +- packages/sdk/package.json | 1 + .../sdk/src/__tests__/utils/index.test.ts | 25 ++ packages/sdk/src/example.test.ts | 4 - scripts/aggregate-coverage.js | 87 ++++ sonar-project.properties | 15 + yarn.lock | 376 +++++++++++++++++- 13 files changed, 611 insertions(+), 54 deletions(-) create mode 100644 .github/actions/sonar/actions.yml delete mode 100644 .github/workflows/run-tests.yml create mode 100644 .github/workflows/unit-tests-and-code-quality.yml create mode 100644 packages/sdk/src/__tests__/utils/index.test.ts delete mode 100644 packages/sdk/src/example.test.ts create mode 100644 scripts/aggregate-coverage.js create mode 100644 sonar-project.properties diff --git a/.github/actions/sonar/actions.yml b/.github/actions/sonar/actions.yml new file mode 100644 index 000000000..c75a7b316 --- /dev/null +++ b/.github/actions/sonar/actions.yml @@ -0,0 +1,47 @@ +name: 'Run Sonar tests' +description: 'Upload code quality scans to Sonar' +inputs: + github-token: + description: GitHub token + required: true + sonar-token: + description: Sonar token + required: true + sonar-host: + description: Sonar host URL + required: true + coverage-file-name: + description: Name of the generic coverage file + required: true + branch: + description: Branch + required: true + pull-request-number: + description: PR number + required: false + base-branch: + description: PR target branch + required: false + pull-request-sha: + description: PR commit SHA + required: false + +runs: + using: "composite" + steps: + - name: Install Sonar + shell: bash + run: | + brew install sonar-scanner + - name: Update sonar-project.properties + shell: bash + run: | + echo "sonar.pullrequest.key=${{ inputs.pull-request-number }}" >> sonar-project.properties + echo "sonar.pullrequest.branch=${{ inputs.branch }}" >> sonar-project.properties + echo "sonar.pullrequest.base=${{ inputs.base-branch }}" >> sonar-project.properties + echo "sonar.scm.revision=${{ inputs.pull-request-sha }}" >> sonar-project.properties + echo "sonar.javascript.lcov.reportPaths=${{ inputs.coverage-file-name }}" >> sonar-project.properties + - name: Run Sonar + shell: bash + run: | + sonar-scanner -Dsonar.token=${{ inputs.sonar-token }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml deleted file mode 100644 index 94f3eb695..000000000 --- a/.github/workflows/run-tests.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Run Jest Tests - -on: pull_request - -jobs: - run-tests: - runs-on: ubuntu-latest - name: Execute Jest Unit Tests - - steps: - - name: Cancel previous run workflows - uses: styfle/cancel-workflow-action@0.12.1 - with: - access_token: ${{ github.token }} - - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup Node.js - uses: actions/setup-node@v4.0.2 - with: - node-version: '18' - cache: 'yarn' - - - name: Install dependencies - run: yarn install - - - name: Run Jest Tests - run: yarn test - env: - CI: true - - - name: Post test results to GitHub PR - if: always() # This ensures the report step runs whether the tests pass or fail - run: | - echo "Test results summary" >> ${{ github.workspace }}/test-results.md - gh pr comment ${{ github.event.pull_request.number }} --body-file ${{ github.workspace }}/test-results.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/unit-tests-and-code-quality.yml b/.github/workflows/unit-tests-and-code-quality.yml new file mode 100644 index 000000000..05effff71 --- /dev/null +++ b/.github/workflows/unit-tests-and-code-quality.yml @@ -0,0 +1,50 @@ +name: Unit Tests and Code Quality +on: push +jobs: + run-unit-tests: + name: Run unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: 'yarn' + node-version-file: '.nvmrc' + + - name: Install modules + run: yarn install --immutable + + - name: Run tests and generate lcov report + run: yarn test:unit:coverage:lcov -- --maxWorkers=1 + + - uses: actions/upload-artifact@master + with: + name: coverage-file + path: coverage + + sonarcloud: + needs: + - run-unit-tests + name: Run Code checks using Sonar + runs-on: macos-13-large + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: actions/download-artifact@master + with: + name: coverage-file + path: coverage + - name: SonarCloud Scan + uses: ./.github/actions/sonar + with: + github-token: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + sonar-token: ${{ secrets.SONAR_TOKEN }} + sonar-host: https://sonarcloud.io. + pull-request-number: ${{ github.event.pull_request.number }} + branch: ${{ github.head_ref }} + base-branch: ${{ github.base_ref }} + pull-request-sha: ${{ github.event.pull_request.head.sha }} + coverage-file-name: ./coverage/lcov.info diff --git a/.gitignore b/.gitignore index 3bcbe9c90..75c1a2081 100644 --- a/.gitignore +++ b/.gitignore @@ -64,4 +64,9 @@ android/keystores/debug.keystore lib/ # npm -.npmrc \ No newline at end of file +.npmrc + +# files +**/coverage/* +**/coverage.json +.nyc_output/ diff --git a/package.json b/package.json index 90bab472f..8919e0add 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "scripts": { "bootstrap": "yarn install", "pods": "cd packages/example/ios && pod-install --quiet", - "test": "yarn --cwd packages/sdk test" + "test": "yarn --cwd packages/sdk test", + "test:unit:coverage:lcov": "yarn --cwd packages/sdk test && node scripts/aggregate-coverage.js && nyc report --reporter lcov" } } diff --git a/packages/sdk/android/build.gradle b/packages/sdk/android/build.gradle index 59ba302bd..9df62c3ed 100644 --- a/packages/sdk/android/build.gradle +++ b/packages/sdk/android/build.gradle @@ -29,6 +29,8 @@ def getExtOrIntegerDefault(name) { } android { + group 'com.example.myapp.myfeature' + compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') buildToolsVersion getExtOrDefault('buildToolsVersion') defaultConfig { diff --git a/packages/sdk/jest.config.js b/packages/sdk/jest.config.js index 8df203f54..f0d697a30 100644 --- a/packages/sdk/jest.config.js +++ b/packages/sdk/jest.config.js @@ -1,7 +1,12 @@ module.exports = { preset: 'ts-jest', testEnvironment: 'node', + testRegex: '/__tests__/.*\\.test\\.[j|t]s$', + collectCoverageFrom: ['src/**/{!(hooks|manifest),}.ts'], + collectCoverage: true, + coveragePathIgnorePatterns: ['node_modules', '.module.ts', '.mock.ts'], transform: { - '^.+\\.tsx?$': 'ts-jest', + '\\.[jt]s$': 'ts-jest', + '\\.[jt]sx$': 'ts-jest', }, - }; \ No newline at end of file + }; diff --git a/packages/sdk/package.json b/packages/sdk/package.json index aaf7340e7..cdb7bdbdb 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -135,6 +135,7 @@ ] }, "dependencies": { + "nyc": "^15.1.0", "uuid": "^8.3.2" } } diff --git a/packages/sdk/src/__tests__/utils/index.test.ts b/packages/sdk/src/__tests__/utils/index.test.ts new file mode 100644 index 000000000..979d34465 --- /dev/null +++ b/packages/sdk/src/__tests__/utils/index.test.ts @@ -0,0 +1,25 @@ +import { toRgbColor } from "../../utils/index"; + +describe('toRgbColor function', () => { + it('should return null for invalid hex color strings', () => { + expect(toRgbColor('#abc')).toBeNull(); // Too short hex string + expect(toRgbColor('#12z34')).toBeNull(); // Non-hex characters + expect(toRgbColor('#12345')).toBeNull(); // Too short hex string + expect(toRgbColor('123456')).toBeNull(); // Missing # symbol + expect(toRgbColor('red')).toBeNull(); // Non-hex string + }); + + it('should return correct RGB color object for valid hex color strings', () => { + // Test for RGB color without alpha + expect(toRgbColor('#ffffff')).toEqual({ red: 255, green: 255, blue: 255, alpha: 1 }); + + // Test for RGB color with alpha + expect(toRgbColor('#00000000')).toEqual({ red: 0, green: 0, blue: 0, alpha: 1 }); + + // Test for lower case hex string + expect(toRgbColor('#abcdef')).toEqual({ red: 171, green: 205, blue: 239, alpha: 1 }); + + // Test for upper case hex string + expect(toRgbColor('#ABCDEF')).toEqual({ red: 171, green: 205, blue: 239, alpha: 1 }); + }); +}); diff --git a/packages/sdk/src/example.test.ts b/packages/sdk/src/example.test.ts deleted file mode 100644 index 4c089c014..000000000 --- a/packages/sdk/src/example.test.ts +++ /dev/null @@ -1,4 +0,0 @@ -// example.test.ts -test('true to be true', () => { - expect(true).toBe(true); - }); \ No newline at end of file diff --git a/scripts/aggregate-coverage.js b/scripts/aggregate-coverage.js new file mode 100644 index 000000000..deb4ab102 --- /dev/null +++ b/scripts/aggregate-coverage.js @@ -0,0 +1,87 @@ +const fs = require('fs'); +const path = require('path'); + +const REPORTS_DIR_NAME = '.nyc_output'; +const PACKAGES_DIR_NAME = 'packages'; +const PACKAGE_PATH = path.resolve(process.cwd(), PACKAGES_DIR_NAME); +const REPORTS_DIR_PATH = path.resolve(process.cwd(), REPORTS_DIR_NAME); + +// Function to create a temporary directory if it doesn't exist +function createTempDir() { + if (!fs.existsSync(REPORTS_DIR_PATH)) { + fs.mkdirSync(REPORTS_DIR_PATH); + } +} + +// Function to recursively find 'coverage' folders within a directory +function findCoverageFolders(directory, maxDepth = 5, currentDepth = 0) { + let coverageFolders = []; + + const files = fs.readdirSync(directory); + + for (const file of files) { + const filePath = path.join(directory, file); + const stats = fs.statSync(filePath); + + if (stats.isDirectory()) { + if (file === 'coverage') { + coverageFolders.push(filePath); + } else if (currentDepth < maxDepth) { + const subdirectoryCoverageFolders = findCoverageFolders( + filePath, + maxDepth, + currentDepth + 1, + ); + coverageFolders = coverageFolders.concat(subdirectoryCoverageFolders); + } + } + } + + return coverageFolders; +} + +// Function to generate reports by copying coverage files to a temporary directory +function generateReports() { + const coverageFolders = findCoverageFolders(PACKAGE_PATH); + console.log(coverageFolders); + + coverageFolders.forEach((coverageFolder) => { + const coverageFinalFilePath = path.resolve( + coverageFolder, + 'coverage-final.json', + ); + + fs.stat(coverageFinalFilePath, (error, stats) => { + if (error) { + console.error(`Error accessing file: ${coverageFinalFilePath}`, error); + return; + } + + try { + const packageName = coverageFolder.split('/').slice(-2)[0]; + const destFilePath = path.resolve( + REPORTS_DIR_PATH, + `${packageName}.json`, + ); + + if (fs.existsSync(coverageFinalFilePath)) { + fs.copyFileSync(coverageFinalFilePath, destFilePath); + console.log(`Report generated for ${packageName}`); + } else { + console.warn(`Coverage file not found: ${coverageFinalFilePath}`); + } + } catch (error) { + console.error('Failed to generate reports', error); + } + }); + }); +} + +// Main function to aggregate reports +function aggregateReports() { + createTempDir(); + generateReports(); +} + +// Start the aggregation process +aggregateReports(); diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..8e304ced6 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,15 @@ +# Project core settings +sonar.projectKey=primer-io_primer-sdk-react-native +sonar.organization=primerio +sonar.host.url=https://sonarcloud.io + +sonar.sourceEncoding=UTF-8 + +# Source settings +sonar.sources=packages + +# Exclusions +sonar.exclusions=**/jest.config.js,**/*.test.js,packages/example/** +# GitHub +sonar.pullrequest.provider=GitHub +sonar.github.repository=primer-io/primer-sdk diff --git a/yarn.lock b/yarn.lock index c05709748..0d8004cc0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30,6 +30,14 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" +"@babel/code-frame@^7.24.2": + version "7.24.2" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.2.tgz#718b4b19841809a58b29b68cde80bc5e1aa6d9ae" + integrity sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ== + dependencies: + "@babel/highlight" "^7.24.2" + picocolors "^1.0.0" + "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.23.3", "@babel/compat-data@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" @@ -56,6 +64,27 @@ json5 "^2.2.3" semver "^6.3.1" +"@babel/core@^7.7.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.5.tgz#15ab5b98e101972d171aeef92ac70d8d6718f06a" + integrity sha512-tVQRucExLQ02Boi4vdPp49svNGcfL2GhdTCT9aldhXgCJVAI21EtRfBettiuLUwce/7r6bFdgs6JFkcdTiFttA== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.2" + "@babel/generator" "^7.24.5" + "@babel/helper-compilation-targets" "^7.23.6" + "@babel/helper-module-transforms" "^7.24.5" + "@babel/helpers" "^7.24.5" + "@babel/parser" "^7.24.5" + "@babel/template" "^7.24.0" + "@babel/traverse" "^7.24.5" + "@babel/types" "^7.24.5" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + "@babel/eslint-parser@^7.20.0": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.23.3.tgz#7bf0db1c53b54da0c8a12627373554a0828479ca" @@ -75,6 +104,16 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.5.tgz#e5afc068f932f05616b66713e28d0f04e99daeb3" + integrity sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA== + dependencies: + "@babel/types" "^7.24.5" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" @@ -169,6 +208,13 @@ dependencies: "@babel/types" "^7.22.15" +"@babel/helper-module-imports@^7.24.3": + version "7.24.3" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz#6ac476e6d168c7c23ff3ba3cf4f7841d46ac8128" + integrity sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg== + dependencies: + "@babel/types" "^7.24.0" + "@babel/helper-module-transforms@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" @@ -180,6 +226,17 @@ "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.20" +"@babel/helper-module-transforms@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.24.5.tgz#ea6c5e33f7b262a0ae762fd5986355c45f54a545" + integrity sha512-9GxeY8c2d2mdQUP1Dye0ks3VDyIMS98kt/llQ2nUId8IsWqTF0l1LkSX0/uP7l7MCDrzXS009Hyhe2gzTiGW8A== + dependencies: + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-module-imports" "^7.24.3" + "@babel/helper-simple-access" "^7.24.5" + "@babel/helper-split-export-declaration" "^7.24.5" + "@babel/helper-validator-identifier" "^7.24.5" + "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" @@ -217,6 +274,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-simple-access@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.5.tgz#50da5b72f58c16b07fbd992810be6049478e85ba" + integrity sha512-uH3Hmf5q5n7n8mz7arjUlDOCbttY/DW4DYhE6FUsjKJ/oYC1kQQUvwEQWxRwUpX9qQKRXeqLwWxrqilMrf32sQ== + dependencies: + "@babel/types" "^7.24.5" + "@babel/helper-skip-transparent-expression-wrappers@^7.20.0", "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" @@ -231,16 +295,33 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-split-export-declaration@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.5.tgz#b9a67f06a46b0b339323617c8c6213b9055a78b6" + integrity sha512-5CHncttXohrHk8GWOFCcCl4oRD9fKosWlIRgWm4ql9VYioKm52Mk2xsmoohvm7f3JoiLSM5ZgJuRaf5QZZYd3Q== + dependencies: + "@babel/types" "^7.24.5" + "@babel/helper-string-parser@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== +"@babel/helper-string-parser@^7.24.1": + version "7.24.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz#f99c36d3593db9540705d0739a1f10b5e20c696e" + integrity sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ== + "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.5.tgz#918b1a7fa23056603506370089bd990d8720db62" + integrity sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA== + "@babel/helper-validator-option@^7.22.15", "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" @@ -264,6 +345,15 @@ "@babel/traverse" "^7.23.6" "@babel/types" "^7.23.6" +"@babel/helpers@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.5.tgz#fedeb87eeafa62b621160402181ad8585a22a40a" + integrity sha512-CiQmBMMpMQHwM5m01YnrM6imUG1ebgYJ+fAIW4FZe6m4qHTPaRHti+R8cggAwkdz4oXhtO4/K9JWlh+8hIfR2Q== + dependencies: + "@babel/template" "^7.24.0" + "@babel/traverse" "^7.24.5" + "@babel/types" "^7.24.5" + "@babel/highlight@^7.10.4", "@babel/highlight@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" @@ -273,11 +363,26 @@ chalk "^2.4.2" js-tokens "^4.0.0" +"@babel/highlight@^7.24.2": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.5.tgz#bc0613f98e1dd0720e99b2a9ee3760194a704b6e" + integrity sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw== + dependencies: + "@babel/helper-validator-identifier" "^7.24.5" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + "@babel/parser@^7.1.0", "@babel/parser@^7.13.16", "@babel/parser@^7.14.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.0", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.6", "@babel/parser@^7.7.0": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== +"@babel/parser@^7.24.0", "@babel/parser@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.5.tgz#4a4d5ab4315579e5398a82dcf636ca80c3392790" + integrity sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz#5cd1c87ba9380d0afb78469292c954fee5d2411a" @@ -1164,6 +1269,15 @@ "@babel/parser" "^7.22.15" "@babel/types" "^7.22.15" +"@babel/template@^7.24.0": + version "7.24.0" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.0.tgz#c6a524aa93a4a05d66aaf31654258fae69d87d50" + integrity sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/parser" "^7.24.0" + "@babel/types" "^7.24.0" + "@babel/traverse@^7.20.0", "@babel/traverse@^7.23.6", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.4": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" @@ -1180,6 +1294,22 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.5.tgz#972aa0bc45f16983bf64aa1f877b2dd0eea7e6f8" + integrity sha512-7aaBLeDQ4zYcUFDUD41lJc1fG8+5IU9DaNSJAgal866FGvmD5EbWQgnEC6kO1gGLsX0esNkfnJSndbTXA3r7UA== + dependencies: + "@babel/code-frame" "^7.24.2" + "@babel/generator" "^7.24.5" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.24.5" + "@babel/parser" "^7.24.5" + "@babel/types" "^7.24.5" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.20.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.4", "@babel/types@^7.23.6", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" @@ -1189,6 +1319,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.24.0", "@babel/types@^7.24.5": + version "7.24.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.5.tgz#7661930afc638a5383eb0c4aee59b74f38db84d7" + integrity sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ== + dependencies: + "@babel/helper-string-parser" "^7.24.1" + "@babel/helper-validator-identifier" "^7.24.5" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1678,6 +1817,15 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" @@ -1688,6 +1836,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + "@jridgewell/source-map@^0.3.3": version "0.3.5" resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.5.tgz#a3bb4d5c6825aab0d281268f47f6ad5853431e91" @@ -1709,6 +1862,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": version "5.1.1-v1" resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" @@ -2822,6 +2983,18 @@ appdirsjs@^1.2.4: resolved "https://registry.yarnpkg.com/appdirsjs/-/appdirsjs-1.2.7.tgz#50b4b7948a26ba6090d4aede2ae2dc2b051be3b3" integrity sha512-Quji6+8kLBC3NnBeo14nPDq0+2jUs5s3/xEye+udFHumHhRk4M7aAMXp/PBJqkKYGuuyR9M/6Dq7d2AViiGmhw== +append-transform@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-2.0.0.tgz#99d9d29c7b38391e6f428d28ce136551f0b77e12" + integrity sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg== + dependencies: + default-require-extensions "^3.0.0" + +archy@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" + integrity sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw== + argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -3754,6 +3927,16 @@ cacheable-request@^10.2.8: normalize-url "^8.0.0" responselike "^3.0.0" +caching-transform@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-4.0.0.tgz#00d297a4206d71e2163c39eaffa8157ac0651f0f" + integrity sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA== + dependencies: + hasha "^5.0.0" + make-dir "^3.0.0" + package-hash "^4.0.0" + write-file-atomic "^3.0.0" + call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.4, call-bind@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" @@ -4280,6 +4463,11 @@ conventional-recommended-bump@^6.1.0: meow "^8.0.0" q "^1.5.1" +convert-source-map@^1.7.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" @@ -4490,6 +4678,13 @@ default-browser@^4.0.0: execa "^7.1.1" titleize "^3.0.0" +default-require-extensions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-3.0.1.tgz#bfae00feeaeada68c2ae256c62540f60b80625bd" + integrity sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw== + dependencies: + strip-bom "^4.0.0" + defaults@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" @@ -4825,6 +5020,11 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +es6-error@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" + integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg== + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -5389,6 +5589,15 @@ find-cache-dir@^2.0.0: make-dir "^2.0.0" pkg-dir "^3.0.0" +find-cache-dir@^3.2.0: + version "3.3.2" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz#b30c5b6eff0730731aea9bbd9dbecbd80256d64b" + integrity sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" + find-up@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" @@ -5472,6 +5681,14 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +foreground-child@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53" + integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^3.0.2" + form-data-encoder@^2.1.2: version "2.1.4" resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-2.1.4.tgz#261ea35d2a70d48d30ec7a9603130fa5515e9cd5" @@ -5498,6 +5715,11 @@ fresh@0.5.2: resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== +fromentries@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" + integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== + fs-extra@^10.1.0: version "10.1.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" @@ -5827,7 +6049,7 @@ graceful-fs@4.2.10: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -5905,6 +6127,14 @@ has-yarn@^3.0.0: resolved "https://registry.yarnpkg.com/has-yarn/-/has-yarn-3.0.0.tgz#c3c21e559730d1d3b57e28af1f30d06fac38147d" integrity sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA== +hasha@^5.0.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/hasha/-/hasha-5.2.2.tgz#a48477989b3b327aea3c04f53096d816d97522a1" + integrity sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ== + dependencies: + is-stream "^2.0.0" + type-fest "^0.8.0" + hasown@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" @@ -6532,7 +6762,7 @@ is-weakset@^2.0.1: call-bind "^1.0.2" get-intrinsic "^1.1.1" -is-windows@^1.0.1: +is-windows@^1.0.1, is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== @@ -6590,6 +6820,23 @@ istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== +istanbul-lib-hook@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz#8f84c9434888cc6b1d0a9d7092a76d239ebf0cc6" + integrity sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ== + dependencies: + append-transform "^2.0.0" + +istanbul-lib-instrument@^4.0.0: + version "4.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz#873c6fff897450118222774696a3f28902d77c1d" + integrity sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ== + dependencies: + "@babel/core" "^7.7.5" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.0.0" + semver "^6.3.0" + istanbul-lib-instrument@^5.0.4: version "5.2.1" resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" @@ -6612,6 +6859,18 @@ istanbul-lib-instrument@^6.0.0: istanbul-lib-coverage "^3.2.0" semver "^7.5.4" +istanbul-lib-processinfo@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz#366d454cd0dcb7eb6e0e419378e60072c8626169" + integrity sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg== + dependencies: + archy "^1.0.0" + cross-spawn "^7.0.3" + istanbul-lib-coverage "^3.2.0" + p-map "^3.0.0" + rimraf "^3.0.0" + uuid "^8.3.2" + istanbul-lib-report@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" @@ -6630,6 +6889,14 @@ istanbul-lib-source-maps@^4.0.0: istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" +istanbul-reports@^3.0.2: + version "3.1.7" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" + integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + istanbul-reports@^3.1.3: version "3.1.6" resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" @@ -7328,6 +7595,11 @@ lodash.escaperegexp@^4.1.2: resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" integrity sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw== +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + integrity sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ== + lodash.ismatch@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" @@ -7442,6 +7714,13 @@ make-dir@^2.0.0, make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" +make-dir@^3.0.0, make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + make-dir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" @@ -8244,6 +8523,13 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== +node-preload@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/node-preload/-/node-preload-0.2.1.tgz#c03043bb327f417a18fee7ab7ee57b408a144301" + integrity sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ== + dependencies: + process-on-spawn "^1.0.0" + node-releases@^2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" @@ -8310,6 +8596,39 @@ nullthrows@^1.1.1: resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1" integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw== +nyc@^15.1.0: + version "15.1.0" + resolved "https://registry.yarnpkg.com/nyc/-/nyc-15.1.0.tgz#1335dae12ddc87b6e249d5a1994ca4bdaea75f02" + integrity sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A== + dependencies: + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + caching-transform "^4.0.0" + convert-source-map "^1.7.0" + decamelize "^1.2.0" + find-cache-dir "^3.2.0" + find-up "^4.1.0" + foreground-child "^2.0.0" + get-package-type "^0.1.0" + glob "^7.1.6" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-hook "^3.0.0" + istanbul-lib-instrument "^4.0.0" + istanbul-lib-processinfo "^2.0.2" + istanbul-lib-report "^3.0.0" + istanbul-lib-source-maps "^4.0.0" + istanbul-reports "^3.0.2" + make-dir "^3.0.0" + node-preload "^0.2.1" + p-map "^3.0.0" + process-on-spawn "^1.0.0" + resolve-from "^5.0.0" + rimraf "^3.0.0" + signal-exit "^3.0.2" + spawn-wrap "^2.0.0" + test-exclude "^6.0.0" + yargs "^15.0.2" + ob1@0.76.5: version "0.76.5" resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.76.5.tgz#85476959743d8f6722faf0ac29bee8861f50120b" @@ -8568,6 +8887,13 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +p-map@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-3.0.0.tgz#d704d9af8a2ba684e2600d9a215983d4141a979d" + integrity sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ== + dependencies: + aggregate-error "^3.0.0" + p-map@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" @@ -8607,6 +8933,16 @@ pac-resolver@^6.0.1: ip "^1.1.8" netmask "^2.0.2" +package-hash@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/package-hash/-/package-hash-4.0.0.tgz#3537f654665ec3cc38827387fc904c163c54f506" + integrity sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ== + dependencies: + graceful-fs "^4.1.15" + hasha "^5.0.0" + lodash.flattendeep "^4.4.0" + release-zalgo "^1.0.0" + package-json@^8.1.0: version "8.1.1" resolved "https://registry.yarnpkg.com/package-json/-/package-json-8.1.1.tgz#3e9948e43df40d1e8e78a85485f1070bf8f03dc8" @@ -8745,7 +9081,7 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" -pkg-dir@^4.2.0: +pkg-dir@^4.1.0, pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== @@ -8822,6 +9158,13 @@ process-nextick-args@~2.0.0: resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== +process-on-spawn@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/process-on-spawn/-/process-on-spawn-1.0.0.tgz#95b05a23073d30a17acfdc92a440efd2baefdc93" + integrity sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg== + dependencies: + fromentries "^1.2.0" + process@^0.11.10: version "0.11.10" resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" @@ -9379,6 +9722,13 @@ release-it@^15.5.0: wildcard-match "5.1.2" yargs-parser "21.1.1" +release-zalgo@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" + integrity sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA== + dependencies: + es6-error "^4.0.1" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -9484,7 +9834,7 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^3.0.2: +rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -9840,6 +10190,18 @@ source-map@^0.7.3: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== +spawn-wrap@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-2.0.0.tgz#103685b8b8f9b79771318827aa78650a610d457e" + integrity sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg== + dependencies: + foreground-child "^2.0.0" + is-windows "^1.0.2" + make-dir "^3.0.0" + rimraf "^3.0.0" + signal-exit "^3.0.2" + which "^2.0.1" + spdx-correct@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.2.0.tgz#4f5ab0668f0059e34f9c00dce331784a12de4e9c" @@ -10332,7 +10694,7 @@ type-fest@^0.7.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== -type-fest@^0.8.1: +type-fest@^0.8.0, type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== @@ -10782,7 +11144,7 @@ write-file-atomic@^2.3.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" -write-file-atomic@^3.0.3: +write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== @@ -10870,7 +11232,7 @@ yargs-parser@^20.2.2, yargs-parser@^20.2.3: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs@^15.1.0: +yargs@^15.0.2, yargs@^15.1.0: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== From 0c8f330995b9f733e9dae233ab4b78b5343c4c2e Mon Sep 17 00:00:00 2001 From: Semir Date: Wed, 15 May 2024 15:36:02 +0200 Subject: [PATCH 02/42] ci: update node setup --- .github/workflows/unit-tests-and-code-quality.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/unit-tests-and-code-quality.yml b/.github/workflows/unit-tests-and-code-quality.yml index 05effff71..931b52385 100644 --- a/.github/workflows/unit-tests-and-code-quality.yml +++ b/.github/workflows/unit-tests-and-code-quality.yml @@ -11,7 +11,6 @@ jobs: uses: actions/setup-node@v3 with: cache: 'yarn' - node-version-file: '.nvmrc' - name: Install modules run: yarn install --immutable From 96a071aac5b01a2bed2539171ec10594fa73db9f Mon Sep 17 00:00:00 2001 From: Semir Date: Wed, 15 May 2024 15:38:31 +0200 Subject: [PATCH 03/42] chore: rename sonar action --- .github/actions/sonar/{actions.yml => action.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/actions/sonar/{actions.yml => action.yml} (100%) diff --git a/.github/actions/sonar/actions.yml b/.github/actions/sonar/action.yml similarity index 100% rename from .github/actions/sonar/actions.yml rename to .github/actions/sonar/action.yml From e5d4c045bd0e4c6205a0161b0900842fd7504585 Mon Sep 17 00:00:00 2001 From: Semir Date: Wed, 15 May 2024 15:42:50 +0200 Subject: [PATCH 04/42] chore: exclude C, CPP and ObjC files --- sonar-project.properties | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sonar-project.properties b/sonar-project.properties index 8e304ced6..801ba8b7a 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -10,6 +10,12 @@ sonar.sources=packages # Exclusions sonar.exclusions=**/jest.config.js,**/*.test.js,packages/example/** + # GitHub sonar.pullrequest.provider=GitHub sonar.github.repository=primer-io/primer-sdk + +# C, C++, ObjC exclusions +sonar.c.file.suffixes=- +sonar.cpp.file.suffixes=- +sonar.objc.file.suffixes=- From 3bd70afa5115492d7f98328f16556d7c9983871b Mon Sep 17 00:00:00 2001 From: Semir Date: Wed, 15 May 2024 15:49:40 +0200 Subject: [PATCH 05/42] chore: modify sources --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 801ba8b7a..0fa30c58b 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,10 +6,10 @@ sonar.host.url=https://sonarcloud.io sonar.sourceEncoding=UTF-8 # Source settings -sonar.sources=packages +sonar.sources=packages/sdk # Exclusions -sonar.exclusions=**/jest.config.js,**/*.test.js,packages/example/** +sonar.exclusions=**/jest.config.js,packages/sdk/**/*.test.js,packages/example/** # GitHub sonar.pullrequest.provider=GitHub From 5d419bfdb42ffe85357a6360f11b82dbd909339f Mon Sep 17 00:00:00 2001 From: Semir Date: Wed, 15 May 2024 17:27:33 +0200 Subject: [PATCH 06/42] ci: added Android coverage --- .github/actions/sonar/action.yml | 6 ++++- .../workflows/unit-tests-and-code-quality.yml | 13 ++++++++++ fastlane/AndroidFastFile | 3 +++ packages/sdk/android/build.gradle | 19 ++++++++++++++- .../utils/ErrorHelperTest.kt | 24 +++++++++++++++++++ 5 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 packages/sdk/android/src/test/java/com/primerioreactnative/utils/ErrorHelperTest.kt diff --git a/.github/actions/sonar/action.yml b/.github/actions/sonar/action.yml index c75a7b316..4e7ac7de0 100644 --- a/.github/actions/sonar/action.yml +++ b/.github/actions/sonar/action.yml @@ -11,7 +11,10 @@ inputs: description: Sonar host URL required: true coverage-file-name: - description: Name of the generic coverage file + description: Name of the LCOV coverage file + required: true + coverage-file-name-android: + description: Name of the Kover coverage file required: true branch: description: Branch @@ -41,6 +44,7 @@ runs: echo "sonar.pullrequest.base=${{ inputs.base-branch }}" >> sonar-project.properties echo "sonar.scm.revision=${{ inputs.pull-request-sha }}" >> sonar-project.properties echo "sonar.javascript.lcov.reportPaths=${{ inputs.coverage-file-name }}" >> sonar-project.properties + echo "sonar.coverage.jacoco.xmlReportPaths=${{ inputs.coverage-file-name-android }}" >> sonar-project.properties - name: Run Sonar shell: bash run: | diff --git a/.github/workflows/unit-tests-and-code-quality.yml b/.github/workflows/unit-tests-and-code-quality.yml index 931b52385..c978aade9 100644 --- a/.github/workflows/unit-tests-and-code-quality.yml +++ b/.github/workflows/unit-tests-and-code-quality.yml @@ -23,6 +23,14 @@ jobs: name: coverage-file path: coverage + - name: Run Android unit tests and generate coverage + run: bundle exec fastlane android run_unit_tests_coverage + + - uses: actions/upload-artifact@master + with: + name: coverage-file-android + path: package/sdk/android/build/reports/kover + sonarcloud: needs: - run-unit-tests @@ -36,6 +44,10 @@ jobs: with: name: coverage-file path: coverage + - uses: actions/download-artifact@master + with: + name: coverage-file-android + path: kover - name: SonarCloud Scan uses: ./.github/actions/sonar with: @@ -47,3 +59,4 @@ jobs: base-branch: ${{ github.base_ref }} pull-request-sha: ${{ github.event.pull_request.head.sha }} coverage-file-name: ./coverage/lcov.info + coverage-file-name-android: ./kover/reportsRelease.xml diff --git a/fastlane/AndroidFastFile b/fastlane/AndroidFastFile index 940e69fd3..591905238 100644 --- a/fastlane/AndroidFastFile +++ b/fastlane/AndroidFastFile @@ -84,6 +84,9 @@ platform :android do save_browserstack_id(browserstack_id: ENV['BROWSERSTACK_APP_ID']) end + lane :run_unit_tests_coverage do + gradle(task: "clean koverXmlReportRelease", project_dir: 'packages/example/android/') + end desc 'Store the Browserstack ID into a file' private_lane :save_browserstack_id do |options| diff --git a/packages/sdk/android/build.gradle b/packages/sdk/android/build.gradle index 9df62c3ed..1f7b1ef54 100644 --- a/packages/sdk/android/build.gradle +++ b/packages/sdk/android/build.gradle @@ -1,7 +1,7 @@ buildscript { // Buildscript is evaluated before everything else so we can't use getExtOrDefault def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNative_kotlinVersion'] - + def kover_version = '0.7.6' repositories { google() mavenCentral() @@ -13,12 +13,14 @@ buildscript { // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" + classpath "org.jetbrains.kotlinx:kover-gradle-plugin:$kover_version" } } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' +apply from: "./config/coverage/kover.gradle" def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNative_' + name] @@ -37,6 +39,8 @@ android { minSdkVersion 21 targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') + testInstrumentationRunnerArguments runnerBuilder: 'de.mannodermaus.junit5.AndroidJUnit5Builder' + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { @@ -58,6 +62,13 @@ android { kotlinOptions { freeCompilerArgs += '-Xjvm-default=all' } + testOptions { + execution = 'ANDROIDX_TEST_ORCHESTRATOR' + + unitTests.all { + useJUnitPlatform() + } + } } repositories { @@ -139,4 +150,10 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3" implementation 'io.primer:android:2.27.0' + + testImplementation 'io.mockk:mockk:1.13.10' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2' + testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.2' + testImplementation 'de.mannodermaus.junit5:android-test-runner:1.3.0' } diff --git a/packages/sdk/android/src/test/java/com/primerioreactnative/utils/ErrorHelperTest.kt b/packages/sdk/android/src/test/java/com/primerioreactnative/utils/ErrorHelperTest.kt new file mode 100644 index 000000000..99259f7a1 --- /dev/null +++ b/packages/sdk/android/src/test/java/com/primerioreactnative/utils/ErrorHelperTest.kt @@ -0,0 +1,24 @@ +package com.primerioreactnative.utils + +import com.primerioreactnative.datamodels.ErrorTypeRN +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test + +internal class ErrorHelperTest { + + // Create a mock ErrorTypeRN instance + private val errorType = ErrorTypeRN.InvalidVaultedPaymentMethodId + + @Test + fun `errorTo should create PrimerErrorRN with correct properties`() { + // Mock message + val errorMessage = "This is an error message" + + // Call the infix function + val primerError = errorType errorTo errorMessage + + // Verify the errorId and message are set correctly in the PrimerErrorRN object + assertEquals(errorType.errorId, primerError.errorId) + assertEquals(errorMessage, primerError.description) + } +} From e07fb0f367afdc1ca9c856dceb749e96d2f978b9 Mon Sep 17 00:00:00 2001 From: Semir Date: Wed, 15 May 2024 17:29:42 +0200 Subject: [PATCH 07/42] ci: added Ruby install action --- .github/workflows/unit-tests-and-code-quality.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/unit-tests-and-code-quality.yml b/.github/workflows/unit-tests-and-code-quality.yml index c978aade9..0e78844ef 100644 --- a/.github/workflows/unit-tests-and-code-quality.yml +++ b/.github/workflows/unit-tests-and-code-quality.yml @@ -23,6 +23,11 @@ jobs: name: coverage-file path: coverage + - uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b # v1.174.0 + with: + ruby-version: "2.7" + bundler-cache: true + - name: Run Android unit tests and generate coverage run: bundle exec fastlane android run_unit_tests_coverage From 6c4c01ad292c13c4667d43d286a4bda7932d3b4d Mon Sep 17 00:00:00 2001 From: Semir Date: Wed, 15 May 2024 17:44:19 +0200 Subject: [PATCH 08/42] ci: split jobs ci: fixes ci: fixes ci: add iOS SDK coverage --- .github/actions/ios-sdk-tests/action.yml | 90 +++++++++++++++++++ .github/actions/sonar/action.yml | 4 + .../workflows/unit-tests-and-code-quality.yml | 54 +++++++++-- fastlane/IOSFastFile | 10 ++- packages/sdk/android/build.gradle | 2 +- .../config/coverage-scripts/kover.gradle | 26 ++++++ scripts/xccov-to-sonarqube-generic.sh | 45 ++++++++++ sonar-project.properties | 8 +- 8 files changed, 230 insertions(+), 9 deletions(-) create mode 100644 .github/actions/ios-sdk-tests/action.yml create mode 100644 packages/sdk/android/config/coverage-scripts/kover.gradle create mode 100644 scripts/xccov-to-sonarqube-generic.sh diff --git a/.github/actions/ios-sdk-tests/action.yml b/.github/actions/ios-sdk-tests/action.yml new file mode 100644 index 000000000..eca453487 --- /dev/null +++ b/.github/actions/ios-sdk-tests/action.yml @@ -0,0 +1,90 @@ +name: 'Run iOS SDK tests' +description: 'Test the iOS SDK' +inputs: + ssh-private-key: + description: SSH private key + required: true + known-hosts: + description: Known Hosts + required: true + match-password: + description: Match password + required: true + match-git-private-key: + description: Match git private key + required: true + fastlane-password: + description: Fastlane password + required: true + fastlane-session: + description: Fastlane session + required: true + match-keychain-name: + description: Match keychain name + required: true + match-keychain-password: + description: Match keychain password + required: true + source-branch: + description: Source branch + required: true + coverage-file-name: + description: Name of the generic coverage file + required: true +runs: + using: "composite" + steps: + - name: Select Xcode Version + uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 + with: + xcode-version: '15.2' + - name: Install SSH key + uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 #v2.7.0 + with: + key: ${{ inputs.ssh-private-key }} + name: id_rsa_github_actions + known_hosts: ${{ inputs.known-hosts }} + - uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 + with: + ssh-private-key: ${{ inputs.ssh-private-key }} + - uses: ruby/setup-ruby@d4526a55538b775af234ba4af27118ed6f8f6677 # v1.172.0 + with: + ruby-version: "3.2" + bundler-cache: true + + - name: Install packages + shell: bash + run: | + yarn install + + - name: pod install + shell: bash + run: | + yarn pods + + - name: Create main.jsbundle + shell: bash + run: | + yarn --cwd packages/example build:ios + + - name: Test SDK bridge + shell: bash + run: | + bundle exec fastlane ios tests + env: + MATCH_PASSWORD: ${{ inputs.match-password }} + MATCH_GIT_PRIVATE_KEY: ${{ inputs.ssh-private-key }} + FASTLANE_PASSWORD: ${{ inputs.fastlane-password }} + FASTLANE_SESSION: ${{ inputs.fastlane-session }} + MATCH_KEYCHAIN_NAME: ${{ inputs.match-keychain-name }} + MATCH_KEYCHAIN_PASSWORD: ${{ inputs.match-password }} + SOURCE_BRANCH: ${{ inputs.source-branch }} + - name: Prepare coverage reports + shell: bash + run: | + bash scripts/xccov-to-sonarqube-generic.sh fastlane/test_output/example_0_70_6Tests.xcresult/ > coverage.xml + sed "s#$PWD/##g" coverage.xml > ${{ inputs.coverage-file-name }} + - uses: actions/upload-artifact@master + with: + name: coverage-file-ios + path: ${{ inputs.coverage-file-name }} diff --git a/.github/actions/sonar/action.yml b/.github/actions/sonar/action.yml index 4e7ac7de0..355299e09 100644 --- a/.github/actions/sonar/action.yml +++ b/.github/actions/sonar/action.yml @@ -16,6 +16,9 @@ inputs: coverage-file-name-android: description: Name of the Kover coverage file required: true + coverage-file-name-ios: + description: Name of the iOS generic coverage file + required: true branch: description: Branch required: true @@ -45,6 +48,7 @@ runs: echo "sonar.scm.revision=${{ inputs.pull-request-sha }}" >> sonar-project.properties echo "sonar.javascript.lcov.reportPaths=${{ inputs.coverage-file-name }}" >> sonar-project.properties echo "sonar.coverage.jacoco.xmlReportPaths=${{ inputs.coverage-file-name-android }}" >> sonar-project.properties + echo "sonar.coverageReportPaths=${{ inputs.coverage-file-name-ios }}" >> sonar-project.properties - name: Run Sonar shell: bash run: | diff --git a/.github/workflows/unit-tests-and-code-quality.yml b/.github/workflows/unit-tests-and-code-quality.yml index 0e78844ef..16f4eaa7c 100644 --- a/.github/workflows/unit-tests-and-code-quality.yml +++ b/.github/workflows/unit-tests-and-code-quality.yml @@ -2,10 +2,10 @@ name: Unit Tests and Code Quality on: push jobs: run-unit-tests: - name: Run unit tests + name: Run RN unit tests runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Node.js uses: actions/setup-node@v3 @@ -23,6 +23,20 @@ jobs: name: coverage-file path: coverage + run-unit-tests-android: + name: Run Android unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: 'yarn' + + - name: Install modules + run: yarn install --immutable + - uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b # v1.174.0 with: ruby-version: "2.7" @@ -34,11 +48,41 @@ jobs: - uses: actions/upload-artifact@master with: name: coverage-file-android - path: package/sdk/android/build/reports/kover + path: packages/sdk/android/build/reports + + run-unit-tests-ios: + name: Run iOS unit tests + runs-on: macos-13-large + timeout-minutes: 20 + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + cache: 'yarn' + + - name: Install modules + run: yarn install --immutable + + - name: Run SDK tests + uses: ./.github/actions/ios-sdk-tests + with: + ssh-private-key: ${{ secrets.SSH_KEY }} + known-hosts: ${{ secrets.KNOWN_HOSTS }} + match-password: ${{ secrets.MATCH_PASSWORD }} + match-git-private-key: ${{ secrets.FASTLANE_PASSWORD }} + fastlane-session: ${{ secrets.FASTLANE_SESSION }} + fastlane-password: ${{ secrets.FASTLANE_PASSWORD }} + match-keychain-name: ${{ secrets.MATCH_KEYCHAIN_NAME }} + match-keychain-password: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} + coverage-file-name: sonar-coverage.xml sonarcloud: needs: - run-unit-tests + - run-unit-tests-android + - run-unit-tests-ios name: Run Code checks using Sonar runs-on: macos-13-large steps: @@ -52,7 +96,6 @@ jobs: - uses: actions/download-artifact@master with: name: coverage-file-android - path: kover - name: SonarCloud Scan uses: ./.github/actions/sonar with: @@ -64,4 +107,5 @@ jobs: base-branch: ${{ github.base_ref }} pull-request-sha: ${{ github.event.pull_request.head.sha }} coverage-file-name: ./coverage/lcov.info - coverage-file-name-android: ./kover/reportsRelease.xml + coverage-file-name-android: ./kover/reportRelease.xml + coverage-file-name-ios: sonar-coverage.xml diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index d14dbce03..ccb74f45f 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -31,7 +31,15 @@ platform :ios do ###################### PUBLIC LANES ####################### lane :tests do - run_tests(workspace: app_workspace) + + run_tests(workspace: app_workspace, + destination: "platform=iOS Simulator,name=iPhone 14 Pro", + xcargs: "EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64", + result_bundle: true, + code_coverage: true, + skip_package_dependencies_resolution: true, + output_directory: Dir.pwd + "/test_output" + ) end lane :ui_tests do diff --git a/packages/sdk/android/build.gradle b/packages/sdk/android/build.gradle index 1f7b1ef54..b2098b214 100644 --- a/packages/sdk/android/build.gradle +++ b/packages/sdk/android/build.gradle @@ -20,7 +20,7 @@ buildscript { apply plugin: 'com.android.library' apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' -apply from: "./config/coverage/kover.gradle" +apply from: "./config/coverage-scripts/kover.gradle" def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNative_' + name] diff --git a/packages/sdk/android/config/coverage-scripts/kover.gradle b/packages/sdk/android/config/coverage-scripts/kover.gradle new file mode 100644 index 000000000..c646dd160 --- /dev/null +++ b/packages/sdk/android/config/coverage-scripts/kover.gradle @@ -0,0 +1,26 @@ +apply plugin: 'org.jetbrains.kotlinx.kover' + +subprojects { + koverReport { + filters { + excludes { + packages( + '**.example.**', + ) + } + } + androidReports("release") { + verify { + rule { + // add lower bound for percentage of covered lines + minBound(80) + + // add upper bound for percentage of covered lines + maxBound(100) + } + } + } + } + + tasks["koverXmlReportRelease"].dependsOn "testReleaseUnitTest" +} diff --git a/scripts/xccov-to-sonarqube-generic.sh b/scripts/xccov-to-sonarqube-generic.sh new file mode 100644 index 000000000..b76e1c0a4 --- /dev/null +++ b/scripts/xccov-to-sonarqube-generic.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +set -euo pipefail + +function convert_xccov_to_xml { + sed -n \ + -e '/:$/s/&/\&/g;s/^\(.*\):$/ /p' \ + -e 's/^ *\([0-9][0-9]*\): 0.*$/ /p' \ + -e 's/^ *\([0-9][0-9]*\): [1-9].*$/ /p' \ + -e 's/^$/ <\/file>/p' +} + +function xccov_to_generic { + local xcresult="$1" + + echo '' + xcrun xccov view --archive "$xcresult" | convert_xccov_to_xml + echo '' +} + +function check_xcode_version() { + local major=${1:-0} minor=${2:-0} + return $(( (major >= 14) || (major == 13 && minor >= 3) )) +} + +if ! xcode_version="$(xcodebuild -version | sed -n '1s/^Xcode \([0-9.]*\)$/\1/p')"; then + echo 'Failed to get Xcode version' 1>&2 + exit 1 +elif check_xcode_version ${xcode_version//./ }; then + echo "Xcode version '$xcode_version' not supported, version 13.3 or above is required" 1>&2; + exit 1 +fi + +xcresult="$1" +if [[ $# -ne 1 ]]; then + echo "Invalid number of arguments. Expecting 1 path matching '*.xcresult'" + exit 1 +elif [[ ! -d $xcresult ]]; then + echo "Path not found: $xcresult" 1>&2; + exit 1 +elif [[ $xcresult != *".xcresult"* ]]; then + echo "Expecting input to match '*.xcresult', got: $xcresult" 1>&2; + exit 1 +fi + +xccov_to_generic "$xcresult" diff --git a/sonar-project.properties b/sonar-project.properties index 0fa30c58b..f5300ea54 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -6,10 +6,14 @@ sonar.host.url=https://sonarcloud.io sonar.sourceEncoding=UTF-8 # Source settings -sonar.sources=packages/sdk +sonar.sources=packages/sdk/ +sonar.tests = packages/sdk/ + +# Include test subdirectories in test scope +sonar.test.inclusions = packages/sdk/**/test/**/*, packages/sdk/**/__tests__/**/* # Exclusions -sonar.exclusions=**/jest.config.js,packages/sdk/**/*.test.js,packages/example/** +sonar.exclusions=**/jest.config.js,packages/example/**,packages/sdk/**/test/**/*, packages/sdk/**/__tests__/**/* # GitHub sonar.pullrequest.provider=GitHub From e6b5a8a11423e34f04ba84c60d4ca085b800857a Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 09:53:52 +0200 Subject: [PATCH 09/42] ci: use pinned SHAs for actions --- .github/actions/ios-sdk-tests/action.yml | 4 --- .../workflows/unit-tests-and-code-quality.yml | 26 ++++++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/actions/ios-sdk-tests/action.yml b/.github/actions/ios-sdk-tests/action.yml index eca453487..42b13e5d7 100644 --- a/.github/actions/ios-sdk-tests/action.yml +++ b/.github/actions/ios-sdk-tests/action.yml @@ -84,7 +84,3 @@ runs: run: | bash scripts/xccov-to-sonarqube-generic.sh fastlane/test_output/example_0_70_6Tests.xcresult/ > coverage.xml sed "s#$PWD/##g" coverage.xml > ${{ inputs.coverage-file-name }} - - uses: actions/upload-artifact@master - with: - name: coverage-file-ios - path: ${{ inputs.coverage-file-name }} diff --git a/.github/workflows/unit-tests-and-code-quality.yml b/.github/workflows/unit-tests-and-code-quality.yml index 16f4eaa7c..330fe645a 100644 --- a/.github/workflows/unit-tests-and-code-quality.yml +++ b/.github/workflows/unit-tests-and-code-quality.yml @@ -8,7 +8,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Node.js - uses: actions/setup-node@v3 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: cache: 'yarn' @@ -18,9 +18,9 @@ jobs: - name: Run tests and generate lcov report run: yarn test:unit:coverage:lcov -- --maxWorkers=1 - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: - name: coverage-file + name: coverage-file-rn path: coverage run-unit-tests-android: @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Node.js - uses: actions/setup-node@v3 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: cache: 'yarn' @@ -45,7 +45,7 @@ jobs: - name: Run Android unit tests and generate coverage run: bundle exec fastlane android run_unit_tests_coverage - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 with: name: coverage-file-android path: packages/sdk/android/build/reports @@ -58,7 +58,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Node.js - uses: actions/setup-node@v3 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: cache: 'yarn' @@ -78,6 +78,11 @@ jobs: match-keychain-password: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} coverage-file-name: sonar-coverage.xml + - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 + with: + name: coverage-file-ios + path: sonar-coverage.xml + sonarcloud: needs: - run-unit-tests @@ -89,13 +94,16 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - uses: actions/download-artifact@master + - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: - name: coverage-file + name: coverage-file-rn path: coverage - - uses: actions/download-artifact@master + - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: coverage-file-android + - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 + with: + name: coverage-file-ios - name: SonarCloud Scan uses: ./.github/actions/sonar with: From 68d0a5b2b6bcc0cf01018a90cb11f461bc367d5f Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 09:57:01 +0200 Subject: [PATCH 10/42] ci: fixes --- .github/workflows/unit-tests-and-code-quality.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit-tests-and-code-quality.yml b/.github/workflows/unit-tests-and-code-quality.yml index 330fe645a..e4ba440b0 100644 --- a/.github/workflows/unit-tests-and-code-quality.yml +++ b/.github/workflows/unit-tests-and-code-quality.yml @@ -8,7 +8,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Node.js - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: cache: 'yarn' @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Node.js - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: cache: 'yarn' @@ -58,7 +58,7 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Node.js - - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: cache: 'yarn' @@ -94,16 +94,20 @@ jobs: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: coverage-file-rn path: coverage + - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: coverage-file-android + - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 with: name: coverage-file-ios + - name: SonarCloud Scan uses: ./.github/actions/sonar with: From 79d9e2eda43fa17d3080a26c37eeb4b4e783a4ed Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 10:13:26 +0200 Subject: [PATCH 11/42] fix: remove group --- packages/sdk/android/build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/sdk/android/build.gradle b/packages/sdk/android/build.gradle index b2098b214..df34a0d4c 100644 --- a/packages/sdk/android/build.gradle +++ b/packages/sdk/android/build.gradle @@ -31,8 +31,6 @@ def getExtOrIntegerDefault(name) { } android { - group 'com.example.myapp.myfeature' - compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') buildToolsVersion getExtOrDefault('buildToolsVersion') defaultConfig { From 4b82e11a1e79877bdca3f5dfa8f8421d807b1cc6 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 11:48:14 +0200 Subject: [PATCH 12/42] Add unit tests for iOS --- fastlane/IOSFastFile | 1 + packages/example/ios/Podfile.lock | 6 +- .../example_0_70_6.xcodeproj/project.pbxproj | 33 ++++++++-- .../xcschemes/example_0_70_6.xcscheme | 11 ++++ .../xcschemes/example_0_70_6Tests.xcscheme | 54 +++++++++++++++ .../UIColorExtensionTests.swift | 35 ++++++++++ .../example_0_70_6Tests-Bridging-Header.h | 4 ++ .../example_0_70_6Tests/example_0_70_6Tests.m | 66 ------------------- 8 files changed, 135 insertions(+), 75 deletions(-) create mode 100644 packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme create mode 100644 packages/example/ios/example_0_70_6Tests/UIColorExtensionTests.swift create mode 100644 packages/example/ios/example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h delete mode 100644 packages/example/ios/example_0_70_6Tests/example_0_70_6Tests.m diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index ccb74f45f..32fdd2f89 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -33,6 +33,7 @@ platform :ios do lane :tests do run_tests(workspace: app_workspace, + scheme: "example_0_70_6Tests", destination: "platform=iOS Simulator,name=iPhone 14 Pro", xcargs: "EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64", result_bundle: true, diff --git a/packages/example/ios/Podfile.lock b/packages/example/ios/Podfile.lock index 8c7a8ef9a..ab009eb78 100644 --- a/packages/example/ios/Podfile.lock +++ b/packages/example/ios/Podfile.lock @@ -11,7 +11,7 @@ PODS: - ReactCommon/turbomodule/core (= 0.72.0) - fmt (6.2.1) - glog (0.3.5) - - primer-io-react-native (2.21.0): + - primer-io-react-native (2.21.1): - PrimerSDK (= 2.26.0) - React-Core - Primer3DS (2.3.2) @@ -566,7 +566,7 @@ SPEC CHECKSUMS: FBReactNativeSpec: 6e7e74b1ed7f0a1a469a82a67521b33285f5fef3 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b - primer-io-react-native: 126746c8011a140542efae99945a93d06c514d86 + primer-io-react-native: 01b45d80b85c286c800133a94ffb86cbb45d231a Primer3DS: 81e7969033230c7346a517cd609be956914738bb PrimerIPay88MYSDK: 436ee0be7e2c97e4e81456ccddee20175e9e3c4d PrimerKlarnaSDK: 83e9a1357a7247bf8fa2836fc945cf97644d601d @@ -611,6 +611,6 @@ SPEC CHECKSUMS: SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 Yoga: 1d6727ed193122f6adaf435c3de1a768326ff83b -PODFILE CHECKSUM: 2ccfeb204f53b339ccddcb46e657d385a9286c66 +PODFILE CHECKSUM: fd89a66fa0d850b0f330025172d1f42e4f16a3f5 COCOAPODS: 1.15.2 diff --git a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj index b2e7e1b47..07d33a8ed 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj +++ b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 00E356F31AD99517003FC87E /* example_0_70_6Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* example_0_70_6Tests.m */; }; 04979F682AB1E55A00469C99 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 04979F672AB1E55A00469C99 /* main.jsbundle */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; @@ -15,6 +14,8 @@ 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; A04C067FBCDDDE0375260BBB /* libPods-example_0_70_6.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 80FB55FEE50456A2CC839A71 /* libPods-example_0_70_6.a */; }; D7CE3F61E27E440463A42A2F /* libPods-example_0_70_6-example_0_70_6Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CD0A4D74B8ACFC62D6A65A1 /* libPods-example_0_70_6-example_0_70_6Tests.a */; }; + F004EDB82BF60A4E006F3CAA /* UIColorExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F004EDB72BF60A4E006F3CAA /* UIColorExtensionTests.swift */; }; + F0C3A3482BF60837002E6AC4 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 04979F672AB1E55A00469C99 /* main.jsbundle */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -30,8 +31,8 @@ /* Begin PBXFileReference section */ 00E356EE1AD99517003FC87E /* example_0_70_6Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = example_0_70_6Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* example_0_70_6Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = example_0_70_6Tests.m; sourceTree = ""; }; 04979F672AB1E55A00469C99 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; + 07B636873D52B0997BE847A5 /* libPods-example_0_70_6-ios_sdk_tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example_0_70_6-ios_sdk_tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 10C1B181CC628059C59D015B /* Pods-example_0_70_6-example_0_70_6Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example_0_70_6-example_0_70_6Tests.debug.xcconfig"; path = "Target Support Files/Pods-example_0_70_6-example_0_70_6Tests/Pods-example_0_70_6-example_0_70_6Tests.debug.xcconfig"; sourceTree = ""; }; 13B07F961A680F5B00A75B9A /* example_0_70_6.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example_0_70_6.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example_0_70_6/AppDelegate.h; sourceTree = ""; }; @@ -42,11 +43,15 @@ 1CD0A4D74B8ACFC62D6A65A1 /* libPods-example_0_70_6-example_0_70_6Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example_0_70_6-example_0_70_6Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 46603DD0B577CC2EA4E92775 /* Pods-example_0_70_6-example_0_70_6Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example_0_70_6-example_0_70_6Tests.release.xcconfig"; path = "Target Support Files/Pods-example_0_70_6-example_0_70_6Tests/Pods-example_0_70_6-example_0_70_6Tests.release.xcconfig"; sourceTree = ""; }; 55B32D52CD0F229979D065D1 /* Pods-example_0_70_6.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example_0_70_6.debug.xcconfig"; path = "Target Support Files/Pods-example_0_70_6/Pods-example_0_70_6.debug.xcconfig"; sourceTree = ""; }; + 62FC5DCCB8A4A906B3DDBDDB /* Pods-example_0_70_6-ios_sdk_tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example_0_70_6-ios_sdk_tests.release.xcconfig"; path = "Target Support Files/Pods-example_0_70_6-ios_sdk_tests/Pods-example_0_70_6-ios_sdk_tests.release.xcconfig"; sourceTree = ""; }; 80FB55FEE50456A2CC839A71 /* libPods-example_0_70_6.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-example_0_70_6.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = example_0_70_6/LaunchScreen.storyboard; sourceTree = ""; }; 848652F22954A52C0071549C /* example_0_70_6.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = example_0_70_6.entitlements; path = example_0_70_6/example_0_70_6.entitlements; sourceTree = ""; }; + B7FC3B6D8BEFAD7734A2FDC8 /* Pods-example_0_70_6-ios_sdk_tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example_0_70_6-ios_sdk_tests.debug.xcconfig"; path = "Target Support Files/Pods-example_0_70_6-ios_sdk_tests/Pods-example_0_70_6-ios_sdk_tests.debug.xcconfig"; sourceTree = ""; }; C15C82089BBDB7EBFE153BBA /* Pods-example_0_70_6.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-example_0_70_6.release.xcconfig"; path = "Target Support Files/Pods-example_0_70_6/Pods-example_0_70_6.release.xcconfig"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + F004EDB42BF6091A006F3CAA /* example_0_70_6Tests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "example_0_70_6Tests-Bridging-Header.h"; sourceTree = ""; }; + F004EDB72BF60A4E006F3CAA /* UIColorExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIColorExtensionTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -72,8 +77,9 @@ 00E356EF1AD99517003FC87E /* example_0_70_6Tests */ = { isa = PBXGroup; children = ( - 00E356F21AD99517003FC87E /* example_0_70_6Tests.m */, 00E356F01AD99517003FC87E /* Supporting Files */, + F004EDB42BF6091A006F3CAA /* example_0_70_6Tests-Bridging-Header.h */, + F004EDB72BF60A4E006F3CAA /* UIColorExtensionTests.swift */, ); path = example_0_70_6Tests; sourceTree = ""; @@ -107,6 +113,7 @@ ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 80FB55FEE50456A2CC839A71 /* libPods-example_0_70_6.a */, 1CD0A4D74B8ACFC62D6A65A1 /* libPods-example_0_70_6-example_0_70_6Tests.a */, + 07B636873D52B0997BE847A5 /* libPods-example_0_70_6-ios_sdk_tests.a */, ); name = Frameworks; sourceTree = ""; @@ -149,6 +156,8 @@ C15C82089BBDB7EBFE153BBA /* Pods-example_0_70_6.release.xcconfig */, 10C1B181CC628059C59D015B /* Pods-example_0_70_6-example_0_70_6Tests.debug.xcconfig */, 46603DD0B577CC2EA4E92775 /* Pods-example_0_70_6-example_0_70_6Tests.release.xcconfig */, + B7FC3B6D8BEFAD7734A2FDC8 /* Pods-example_0_70_6-ios_sdk_tests.debug.xcconfig */, + 62FC5DCCB8A4A906B3DDBDDB /* Pods-example_0_70_6-ios_sdk_tests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -206,10 +215,12 @@ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { + LastSwiftUpdateCheck = 1530; LastUpgradeCheck = 1210; TargetAttributes = { 00E356ED1AD99517003FC87E = { CreatedOnToolsVersion = 6.2; + LastSwiftMigration = 1530; TestTargetID = 13B07F861A680F5B00A75B9A; }; 13B07F861A680F5B00A75B9A = { @@ -241,6 +252,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + F0C3A3482BF60837002E6AC4 /* main.jsbundle in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -431,7 +443,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 00E356F31AD99517003FC87E /* example_0_70_6Tests.m in Sources */, + F004EDB82BF60A4E006F3CAA /* UIColorExtensionTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -460,12 +472,13 @@ baseConfigurationReference = 10C1B181CC628059C59D015B /* Pods-example_0_70_6-example_0_70_6Tests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = example_0_70_6Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -478,6 +491,9 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn.tests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example_0_70_6.app/example_0_70_6"; }; name = Debug; @@ -487,9 +503,10 @@ baseConfigurationReference = 46603DD0B577CC2EA4E92775 /* Pods-example_0_70_6-example_0_70_6Tests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; COPY_PHASE_STRIP = NO; INFOPLIST_FILE = example_0_70_6Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -502,6 +519,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn.tests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h"; + SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example_0_70_6.app/example_0_70_6"; }; name = Release; @@ -517,6 +536,7 @@ DEVELOPMENT_TEAM = N8UN9TR5DY; ENABLE_BITCODE = NO; INFOPLIST_FILE = example_0_70_6/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -545,6 +565,7 @@ CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = N8UN9TR5DY; INFOPLIST_FILE = example_0_70_6/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6.xcscheme b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6.xcscheme index aba36d5d9..8adc05bc3 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6.xcscheme +++ b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6.xcscheme @@ -38,6 +38,17 @@ ReferencedContainer = "container:example_0_70_6.xcodeproj"> + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/example/ios/example_0_70_6Tests/UIColorExtensionTests.swift b/packages/example/ios/example_0_70_6Tests/UIColorExtensionTests.swift new file mode 100644 index 000000000..fc6dcab5e --- /dev/null +++ b/packages/example/ios/example_0_70_6Tests/UIColorExtensionTests.swift @@ -0,0 +1,35 @@ +// +// ErrorExtensionTests.swift +// example_0_70_6Tests +// +// Created by Niall Quinn on 16/05/24. +// + +import XCTest +@testable import primer_io_react_native + +final class ErrorExtensionTests: XCTestCase { + + func test_rnError() throws { + // Test case 1: Error is PrimerValidationError + let primerValidationError = PrimerV + var errorDict = primerValidationError.rnError + XCTAssertEqual(errorDict["errorId"], "123") + XCTAssertEqual(errorDict["diagnosticsId"], "456") + XCTAssertEqual(errorDict["description"], "Primer Validation Error") + + // Test case 2: Error is PrimerError + let primerError = PrimerError(errorId: "789", diagnosticsId: "012", description: "Primer Error") + errorDict = primerError.rnError + XCTAssertEqual(errorDict["errorId"], "789") + XCTAssertEqual(errorDict["diagnosticsId"], "012") + XCTAssertEqual(errorDict["description"], "Primer Error") + + // Test case 3: Error is NSError + let nsError = NSError(domain: "com.example.error", code: 404, userInfo: ["inputElementType": "textField"]) + errorDict = nsError.rnError + XCTAssertEqual(errorDict["errorId"], "com.example.error") + XCTAssertEqual(errorDict["inputElementType"], "textField") + } + +} diff --git a/packages/example/ios/example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h b/packages/example/ios/example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h new file mode 100644 index 000000000..1b2cb5d6d --- /dev/null +++ b/packages/example/ios/example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/packages/example/ios/example_0_70_6Tests/example_0_70_6Tests.m b/packages/example/ios/example_0_70_6Tests/example_0_70_6Tests.m deleted file mode 100644 index 7735de1c3..000000000 --- a/packages/example/ios/example_0_70_6Tests/example_0_70_6Tests.m +++ /dev/null @@ -1,66 +0,0 @@ -#import -#import - -#import -#import - -#define TIMEOUT_SECONDS 600 -#define TEXT_TO_LOOK_FOR @"Welcome to React" - -@interface example_0_70_6Tests : XCTestCase - -@end - -@implementation example_0_70_6Tests - -- (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test -{ - if (test(view)) { - return YES; - } - for (UIView *subview in [view subviews]) { - if ([self findSubviewInView:subview matching:test]) { - return YES; - } - } - return NO; -} - -- (void)testRendersWelcomeScreen -{ - UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; - NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; - BOOL foundElement = NO; - - __block NSString *redboxError = nil; -#ifdef DEBUG - RCTSetLogFunction( - ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { - if (level >= RCTLogLevelError) { - redboxError = message; - } - }); -#endif - - while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { - [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; - - foundElement = [self findSubviewInView:vc.view - matching:^BOOL(UIView *view) { - if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { - return YES; - } - return NO; - }]; - } - -#ifdef DEBUG - RCTSetLogFunction(RCTDefaultLogFunction); -#endif - - XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); - XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); -} - -@end From 924169dd831601d902f93d33d52da9819925b361 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 11:48:33 +0200 Subject: [PATCH 13/42] Add latest UIColor Tests --- .../UIColorExtensionTests.swift | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/example/ios/example_0_70_6Tests/UIColorExtensionTests.swift b/packages/example/ios/example_0_70_6Tests/UIColorExtensionTests.swift index fc6dcab5e..7bb01cc30 100644 --- a/packages/example/ios/example_0_70_6Tests/UIColorExtensionTests.swift +++ b/packages/example/ios/example_0_70_6Tests/UIColorExtensionTests.swift @@ -1,5 +1,5 @@ // -// ErrorExtensionTests.swift +// UIColorExtensionTests.swift // example_0_70_6Tests // // Created by Niall Quinn on 16/05/24. @@ -8,28 +8,28 @@ import XCTest @testable import primer_io_react_native -final class ErrorExtensionTests: XCTestCase { - - func test_rnError() throws { - // Test case 1: Error is PrimerValidationError - let primerValidationError = PrimerV - var errorDict = primerValidationError.rnError - XCTAssertEqual(errorDict["errorId"], "123") - XCTAssertEqual(errorDict["diagnosticsId"], "456") - XCTAssertEqual(errorDict["description"], "Primer Validation Error") - - // Test case 2: Error is PrimerError - let primerError = PrimerError(errorId: "789", diagnosticsId: "012", description: "Primer Error") - errorDict = primerError.rnError - XCTAssertEqual(errorDict["errorId"], "789") - XCTAssertEqual(errorDict["diagnosticsId"], "012") - XCTAssertEqual(errorDict["description"], "Primer Error") - - // Test case 3: Error is NSError - let nsError = NSError(domain: "com.example.error", code: 404, userInfo: ["inputElementType": "textField"]) - errorDict = nsError.rnError - XCTAssertEqual(errorDict["errorId"], "com.example.error") - XCTAssertEqual(errorDict["inputElementType"], "textField") +final class UIColorExtensionTests: XCTestCase { + + func test_toHex() throws { + // Tesddt case 1: RGB color without alpha + let color1 = UIColor(red: 0, green: 0, blue: 0, alpha: 1.0) + XCTAssertEqual(color1.toHex(), "000000") + + let color2 = UIColor(red: 1, green: 1, blue: 1, alpha: 1.0) + XCTAssertEqual(color2.toHex(), "FFFFFF") + + let color3 = UIColor(red: 1, green: 0, blue: 0, alpha: 1.0) + XCTAssertEqual(color3.toHex(), "FF0000") + + let color4 = UIColor(red: 0, green: 1, blue: 0, alpha: 1.0) + XCTAssertEqual(color4.toHex(), "00FF00") + + let color5 = UIColor(red: 0, green: 0, blue: 1, alpha: 1.0) + XCTAssertEqual(color5.toHex(), "0000FF") + + let noAlpha = UIColor(red: 0, green: 0, blue: 1, alpha: 1.0) + XCTAssertEqual(noAlpha.toHex(alpha: true), "0000FFFF") + } } From a96a3db97a5c8e488462be1fddb8dce1c22be2c1 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 12:01:04 +0200 Subject: [PATCH 14/42] Define same iOS version as SDK --- fastlane/IOSFastFile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 32fdd2f89..cf10cf4e5 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -31,10 +31,10 @@ platform :ios do ###################### PUBLIC LANES ####################### lane :tests do - + sim_version = options[:sim_version] || "17.2" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", - destination: "platform=iOS Simulator,name=iPhone 14 Pro", + destination: "OS=#{sim_version},name=iPhone 14 Pro", xcargs: "EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64", result_bundle: true, code_coverage: true, From 522ba5cb16172466366bd2c736a42af41436853f Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 12:07:43 +0200 Subject: [PATCH 15/42] Add options --- fastlane/IOSFastFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index cf10cf4e5..08f6fc570 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -30,7 +30,7 @@ platform :ios do ###################### PUBLIC LANES ####################### - lane :tests do + lane :tests do |options| sim_version = options[:sim_version] || "17.2" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", From 05771110d6472551a7660c52b8c03aea95403cf6 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 12:14:24 +0200 Subject: [PATCH 16/42] Change to iPhone SE --- fastlane/IOSFastFile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 08f6fc570..711b3b994 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -31,10 +31,10 @@ platform :ios do ###################### PUBLIC LANES ####################### lane :tests do |options| - sim_version = options[:sim_version] || "17.2" + sim_version = options[:sim_version] || "17.0.1" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", - destination: "OS=#{sim_version},name=iPhone 14 Pro", + destination: "OS=#{sim_version},name=iPhone SE (3rd generation)", xcargs: "EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64", result_bundle: true, code_coverage: true, From 931c999f7f168a151f215d78a8c07b5eb5d50799 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 12:26:54 +0200 Subject: [PATCH 17/42] Remove excluded archs --- fastlane/IOSFastFile | 1 - 1 file changed, 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 711b3b994..30ca771c1 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -35,7 +35,6 @@ platform :ios do run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", destination: "OS=#{sim_version},name=iPhone SE (3rd generation)", - xcargs: "EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 85487ca603c4e684ce554577d823709c26e6715e Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 12:32:47 +0200 Subject: [PATCH 18/42] remove destination --- fastlane/IOSFastFile | 1 - 1 file changed, 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 30ca771c1..aeaff43ab 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -34,7 +34,6 @@ platform :ios do sim_version = options[:sim_version] || "17.0.1" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", - destination: "OS=#{sim_version},name=iPhone SE (3rd generation)", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 670d934354f436edbf63291f35a441239a6e2364 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 12:39:45 +0200 Subject: [PATCH 19/42] Add sdk --- fastlane/IOSFastFile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index aeaff43ab..d3c6ad4d8 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -34,6 +34,8 @@ platform :ios do sim_version = options[:sim_version] || "17.0.1" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", + sdk: "iphonesimulator#{sim_version}", + destination: "os=#{sim_version},name=iphone 14 pro", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 9cf324d501e012642e77f529d37a949aff9b5038 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 12:44:52 +0200 Subject: [PATCH 20/42] Up version --- fastlane/IOSFastFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index d3c6ad4d8..864a89471 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -31,7 +31,7 @@ platform :ios do ###################### PUBLIC LANES ####################### lane :tests do |options| - sim_version = options[:sim_version] || "17.0.1" + sim_version = options[:sim_version] || "17.2" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", From b3c3073f3a0a5ddd3f2580318dd02d9abf72ad77 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 12:52:49 +0200 Subject: [PATCH 21/42] iPhone SE --- fastlane/IOSFastFile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 864a89471..c4d0c609a 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -31,11 +31,10 @@ platform :ios do ###################### PUBLIC LANES ####################### lane :tests do |options| - sim_version = options[:sim_version] || "17.2" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", - destination: "os=#{sim_version},name=iphone 14 pro", + destination: "iPhone SE (3rd generation)", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 7fc45c7f0b445f0acb41e9e2cf3ed5af3d617d8b Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 13:02:32 +0200 Subject: [PATCH 22/42] Add sim version --- fastlane/IOSFastFile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index c4d0c609a..2f7541a5a 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -31,10 +31,11 @@ platform :ios do ###################### PUBLIC LANES ####################### lane :tests do |options| + sim_version = options[:sim_version] || "17.2" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", - destination: "iPhone SE (3rd generation)", + destination: "os=#{sim_version},name=iPhone SE (3rd generation)", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 497761ae06627f8c6624e8dce5cfca471da4429b Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 13:24:35 +0200 Subject: [PATCH 23/42] change sim version --- fastlane/IOSFastFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 2f7541a5a..438f2ea2b 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -31,7 +31,7 @@ platform :ios do ###################### PUBLIC LANES ####################### lane :tests do |options| - sim_version = options[:sim_version] || "17.2" + sim_version = options[:sim_version] || "17.0.1" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", From 64a640f0a197c89dfb28a691fab9bd4346cefb45 Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 13:36:47 +0200 Subject: [PATCH 24/42] added supported platfroms --- fastlane/IOSFastFile | 2 +- packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 438f2ea2b..2f7541a5a 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -31,7 +31,7 @@ platform :ios do ###################### PUBLIC LANES ####################### lane :tests do |options| - sim_version = options[:sim_version] || "17.0.1" + sim_version = options[:sim_version] || "17.2" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", diff --git a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj index 07d33a8ed..e96a5e156 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj +++ b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj @@ -491,6 +491,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn.tests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SWIFT_OBJC_BRIDGING_HEADER = "example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -519,6 +520,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn.tests; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SWIFT_OBJC_BRIDGING_HEADER = "example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example_0_70_6.app/example_0_70_6"; From bd9f303bb9f8841e183923da53d443c090b58437 Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 13:43:17 +0200 Subject: [PATCH 25/42] added supported platfroms --- packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj index e96a5e156..3a26e133a 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj +++ b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj @@ -551,6 +551,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = example_0_70_6; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; @@ -580,6 +581,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = example_0_70_6; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; From 484243d96c23f531eee1a5da4c721bd519bc6b2d Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 14:03:34 +0200 Subject: [PATCH 26/42] updated gems --- Gemfile.lock | 89 ++++++++++--------- .../example_0_70_6.xcodeproj/project.pbxproj | 12 +++ .../xcschemes/example_0_70_6Tests.xcscheme | 2 +- 3 files changed, 60 insertions(+), 43 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 66d297e47..ee81cba23 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,9 @@ GEM remote: https://rubygems.org/ specs: - CFPropertyList (3.0.6) + CFPropertyList (3.0.7) + base64 + nkf rexml activesupport (7.1.2) base64 @@ -13,28 +15,28 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.5) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) - artifactory (3.0.15) + artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.857.0) - aws-sdk-core (3.188.0) - aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (1.929.0) + aws-sdk-core (3.196.1) + aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.5) + aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.73.0) - aws-sdk-core (~> 3, >= 3.188.0) + aws-sdk-kms (1.81.0) + aws-sdk-core (~> 3, >= 3.193.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.140.0) - aws-sdk-core (~> 3, >= 3.188.0) + aws-sdk-s3 (1.151.0) + aws-sdk-core (~> 3, >= 3.194.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.6) - aws-sigv4 (1.7.0) + aws-sigv4 (~> 1.8) + aws-sigv4 (1.8.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) @@ -86,7 +88,7 @@ GEM declarative (0.0.20) digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) - domain_name (0.6.20231109) + domain_name (0.6.20240107) dotenv (2.8.1) drb (2.2.0) ruby2_keywords @@ -94,7 +96,7 @@ GEM escape (0.0.4) ethon (0.16.0) ffi (>= 1.15.0) - excon (0.104.0) + excon (0.110.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -123,15 +125,15 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - fastimage (2.2.7) - fastlane (2.217.0) + fastimage (2.3.1) + fastlane (2.220.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) aws-sdk-s3 (~> 1.0) babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) - colored + colored (~> 1.2) commander (~> 4.6) dotenv (>= 2.1.1, < 3.0.0) emoji_regex (>= 0.1, < 4.0) @@ -143,6 +145,7 @@ GEM gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.3) google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-env (>= 1.6.0, < 2.0.0) google-cloud-storage (~> 1.31) highline (~> 2.0) http-cookie (~> 1.0.5) @@ -151,10 +154,10 @@ GEM mini_magick (>= 4.9.4, < 5.0.0) multipart-post (>= 2.0.0, < 3.0.0) naturally (~> 2.2) - optparse (~> 0.1.1) + optparse (>= 0.1.1, < 1.0.0) plist (>= 3.1.0, < 4.0.0) rubyzip (>= 2.0.0, < 3.0.0) - security (= 0.1.3) + security (= 0.1.5) simctl (~> 1.6.3) terminal-notifier (>= 2.0.0, < 3.0.0) terminal-table (~> 3) @@ -163,7 +166,7 @@ GEM word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) + xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-plugin-browserstack (0.3.2) rest-client (~> 2.0, >= 2.0.2) fastlane-plugin-firebase_app_distribution (0.7.4) @@ -172,9 +175,9 @@ GEM fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.53.0) + google-apis-androidpublisher_v3 (0.54.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.2) + google-apis-core (0.11.3) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -182,26 +185,25 @@ GEM representable (~> 3.0) retriable (>= 2.0, < 4.a) rexml - webrick google-apis-firebaseappdistribution_v1 (0.3.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-iamcredentials_v1 (0.17.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-playcustomapp_v1 (0.13.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.29.0) + google-apis-storage_v1 (0.31.0) google-apis-core (>= 0.11.0, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) + google-cloud-core (1.7.0) + google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) - google-cloud-errors (1.3.1) - google-cloud-storage (1.45.0) + google-cloud-errors (1.4.0) + google-cloud-storage (1.47.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.29.0) + google-apis-storage_v1 (~> 0.31.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) @@ -219,8 +221,9 @@ GEM i18n (1.14.1) concurrent-ruby (~> 1.0) jmespath (1.6.2) - json (2.6.3) - jwt (2.7.1) + json (2.7.2) + jwt (2.8.1) + base64 mime-types (3.5.1) mime-types-data (~> 3.2015) mime-types-data (3.2023.1003) @@ -229,17 +232,18 @@ GEM minitest (5.20.0) molinillo (0.8.0) multi_json (1.15.0) - multipart-post (2.3.0) + multipart-post (2.4.1) mutex_m (0.2.0) nanaimo (0.3.0) nap (1.1.0) naturally (2.2.1) netrc (0.11.0) - optparse (0.1.1) + nkf (0.2.0) + optparse (0.5.0) os (1.1.4) - plist (3.7.0) + plist (3.7.1) public_suffix (4.0.7) - rake (13.1.0) + rake (13.2.1) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -250,13 +254,14 @@ GEM mime-types (>= 1.16, < 4.0) netrc (~> 0.8) retriable (3.1.2) - rexml (3.2.6) + rexml (3.2.8) + strscan (>= 3.0.9) rouge (2.0.7) ruby-macho (2.5.1) ruby2_keywords (0.0.5) rubyzip (2.3.2) - security (0.1.3) - signet (0.18.0) + security (0.1.5) + signet (0.19.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) @@ -264,12 +269,13 @@ GEM simctl (1.6.10) CFPropertyList naturally + strscan (3.1.0) terminal-notifier (2.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) trailblazer-option (0.1.2) tty-cursor (0.7.1) - tty-screen (0.8.1) + tty-screen (0.8.2) tty-spinner (0.9.3) tty-cursor (~> 0.7) typhoeus (1.4.1) @@ -278,9 +284,8 @@ GEM concurrent-ruby (~> 1.0) uber (0.1.0) unicode-display_width (2.5.0) - webrick (1.8.1) word_wrap (1.0.0) - xcodeproj (1.23.0) + xcodeproj (1.24.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) diff --git a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj index 3a26e133a..0a3792ec2 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj +++ b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj @@ -492,9 +492,12 @@ PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn.tests; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OBJC_BRIDGING_HEADER = "example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example_0_70_6.app/example_0_70_6"; }; name = Debug; @@ -521,8 +524,11 @@ PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn.tests; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OBJC_BRIDGING_HEADER = "example_0_70_6Tests/example_0_70_6Tests-Bridging-Header.h"; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example_0_70_6.app/example_0_70_6"; }; name = Release; @@ -552,8 +558,11 @@ PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = example_0_70_6; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -582,7 +591,10 @@ PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = example_0_70_6; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; diff --git a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme index 5c6fb1196..24c59890d 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme +++ b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme @@ -1,7 +1,7 @@ + version = "1.8"> Date: Thu, 16 May 2024 14:32:36 +0200 Subject: [PATCH 27/42] updated gems --- Gemfile | 3 +++ Gemfile.lock | 9 ++++++--- fastlane/IOSFastFile | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 1ec7f8afd..f7a4c11a9 100644 --- a/Gemfile +++ b/Gemfile @@ -8,3 +8,6 @@ gem "cocoapods" plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'PluginFile') eval_gemfile(plugins_path) if File.exist?(plugins_path) + +plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') +eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/Gemfile.lock b/Gemfile.lock index ee81cba23..4b47889db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -169,8 +169,9 @@ GEM xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-plugin-browserstack (0.3.2) rest-client (~> 2.0, >= 2.0.2) - fastlane-plugin-firebase_app_distribution (0.7.4) + fastlane-plugin-firebase_app_distribution (0.9.1) google-apis-firebaseappdistribution_v1 (~> 0.3.0) + google-apis-firebaseappdistribution_v1alpha (~> 0.2.0) ffi (1.16.3) fourflusher (2.3.1) fuzzy_match (2.0.4) @@ -187,6 +188,8 @@ GEM rexml google-apis-firebaseappdistribution_v1 (0.3.0) google-apis-core (>= 0.11.0, < 2.a) + google-apis-firebaseappdistribution_v1alpha (0.2.0) + google-apis-core (>= 0.11.0, < 2.a) google-apis-iamcredentials_v1 (0.17.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-playcustomapp_v1 (0.13.0) @@ -224,9 +227,9 @@ GEM json (2.7.2) jwt (2.8.1) base64 - mime-types (3.5.1) + mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2023.1003) + mime-types-data (3.2024.0507) mini_magick (4.12.0) mini_mime (1.1.5) minitest (5.20.0) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 2f7541a5a..34a990f63 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -35,7 +35,7 @@ platform :ios do run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", - destination: "os=#{sim_version},name=iPhone SE (3rd generation)", + destination: "os=#17.0.1,name=iPhone SE (3rd generation)", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 028b083753ba1b25ca56a74e8b241ae37c0a58c4 Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 14:47:22 +0200 Subject: [PATCH 28/42] updated gems --- fastlane/IOSFastFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 34a990f63..ec7127390 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -35,7 +35,7 @@ platform :ios do run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", - destination: "os=#17.0.1,name=iPhone SE (3rd generation)", + destination: "os=17.0,name=iPhone SE (3rd generation)", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From bdc70d01cf3b3950f7f4d5d8362ae4194f55856f Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 14:53:48 +0200 Subject: [PATCH 29/42] updated gems --- fastlane/IOSFastFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index ec7127390..19873b022 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -35,7 +35,7 @@ platform :ios do run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", - destination: "os=17.0,name=iPhone SE (3rd generation)", + destination: "iPhone SE (3rd generation) (17.0)", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 9c4a567f884ec0bf14d211e6149e715328b05543 Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 15:05:13 +0200 Subject: [PATCH 30/42] updated gems --- .github/workflows/android-build-and-distribute.yml | 2 +- .github/workflows/unit-tests-and-code-quality.yml | 5 +++++ fastlane/IOSFastFile | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android-build-and-distribute.yml b/.github/workflows/android-build-and-distribute.yml index a3e40d276..c704c9f21 100644 --- a/.github/workflows/android-build-and-distribute.yml +++ b/.github/workflows/android-build-and-distribute.yml @@ -17,7 +17,7 @@ jobs: - uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b # v1.174.0 with: - ruby-version: "2.7" + ruby-version: "3.2" bundler-cache: true - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 diff --git a/.github/workflows/unit-tests-and-code-quality.yml b/.github/workflows/unit-tests-and-code-quality.yml index e4ba440b0..f3078eed2 100644 --- a/.github/workflows/unit-tests-and-code-quality.yml +++ b/.github/workflows/unit-tests-and-code-quality.yml @@ -42,6 +42,11 @@ jobs: ruby-version: "2.7" bundler-cache: true + - name: Install packages + shell: bash + run: | + yarn install + - name: Run Android unit tests and generate coverage run: bundle exec fastlane android run_unit_tests_coverage diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 19873b022..341169923 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -35,7 +35,7 @@ platform :ios do run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", - destination: "iPhone SE (3rd generation) (17.0)", + destination: "name=iPhone SE (3rd generation) 17.0", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 810996a490b3dfdb22a634abe5b3cb905986e132 Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 15:14:25 +0200 Subject: [PATCH 31/42] updated gems --- fastlane/IOSFastFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 341169923..b5f51f17f 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -35,7 +35,7 @@ platform :ios do run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", - destination: "name=iPhone SE (3rd generation) 17.0", + destination: "name=iPhone SE (3rd generation) (17.0)", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 606155800008a7689b177cec946c7d0878c6d5f2 Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 15:35:52 +0200 Subject: [PATCH 32/42] updated gems --- .github/workflows/unit-tests-and-code-quality.yml | 2 +- fastlane/IOSFastFile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unit-tests-and-code-quality.yml b/.github/workflows/unit-tests-and-code-quality.yml index f3078eed2..b602e71f3 100644 --- a/.github/workflows/unit-tests-and-code-quality.yml +++ b/.github/workflows/unit-tests-and-code-quality.yml @@ -39,7 +39,7 @@ jobs: - uses: ruby/setup-ruby@6bd3d993c602f6b675728ebaecb2b569ff86e99b # v1.174.0 with: - ruby-version: "2.7" + ruby-version: "3.2" bundler-cache: true - name: Install packages diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index b5f51f17f..2f7541a5a 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -35,7 +35,7 @@ platform :ios do run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", - destination: "name=iPhone SE (3rd generation) (17.0)", + destination: "os=#{sim_version},name=iPhone SE (3rd generation)", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 78257c5753440ed8b34cdeb793535f16d5d11384 Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 15:45:24 +0200 Subject: [PATCH 33/42] added executable --- .../xcschemes/example_0_70_6Tests.xcscheme | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme index 24c59890d..54875dd82 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme +++ b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme @@ -36,6 +36,16 @@ debugDocumentVersioning = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> + + + + + + + + From d53dba343a882dea3024fd0070d3addfccf8af87 Mon Sep 17 00:00:00 2001 From: Semir Date: Thu, 16 May 2024 15:54:52 +0200 Subject: [PATCH 34/42] update device --- fastlane/IOSFastFile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 2f7541a5a..93989ebb5 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -35,7 +35,7 @@ platform :ios do run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", sdk: "iphonesimulator#{sim_version}", - destination: "os=#{sim_version},name=iPhone SE (3rd generation)", + destination: "os=#{sim_version},name=iPhone 14 Plus", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, From 5ef1dfd64e8ac9d974254510350ce98193389409 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 16:05:32 +0200 Subject: [PATCH 35/42] Try app bundle if --- .../ios/example_0_70_6.xcodeproj/project.pbxproj | 12 ++++++++++-- .../xcschemes/example_0_70_6Tests.xcscheme | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj index 0a3792ec2..22dc224ad 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj +++ b/packages/example/ios/example_0_70_6.xcodeproj/project.pbxproj @@ -473,6 +473,9 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = N8UN9TR5DY; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -489,8 +492,9 @@ "-lc++", "$(inherited)", ); - PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn.tests; + PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; @@ -508,7 +512,10 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; + DEVELOPMENT_TEAM = N8UN9TR5DY; INFOPLIST_FILE = example_0_70_6Tests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -521,8 +528,9 @@ "-lc++", "$(inherited)", ); - PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn.tests; + PRODUCT_BUNDLE_IDENTIFIER = com.primerapi.example.rn; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; diff --git a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme index 54875dd82..5053476d7 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme +++ b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> Date: Thu, 16 May 2024 16:30:23 +0200 Subject: [PATCH 36/42] Do pre build action --- fastlane/IOSFastFile | 1 + 1 file changed, 1 insertion(+) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index 93989ebb5..bfe72148d 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -31,6 +31,7 @@ platform :ios do ###################### PUBLIC LANES ####################### lane :tests do |options| + common_pre_build_action sim_version = options[:sim_version] || "17.2" run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", From 4339fa6bbe37342045e9dce5dd8f924e6f6f05e9 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 16:40:25 +0200 Subject: [PATCH 37/42] Try destination --- fastlane/IOSFastFile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index bfe72148d..ef9517ac3 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -33,15 +33,25 @@ platform :ios do lane :tests do |options| common_pre_build_action sim_version = options[:sim_version] || "17.2" + # run_tests(workspace: app_workspace, + # scheme: "example_0_70_6Tests", + # sdk: "iphonesimulator#{sim_version}", + # destination: "os=#{sim_version},name=iPhone 14 Plus", + # result_bundle: true, + # code_coverage: true, + # skip_package_dependencies_resolution: true, + # output_directory: Dir.pwd + "/test_output" + # ) + run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", - sdk: "iphonesimulator#{sim_version}", - destination: "os=#{sim_version},name=iPhone 14 Plus", + destination: "platform=iOS Simulator,name=iPhone 14 Pro", + xcargs: "EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64", result_bundle: true, code_coverage: true, skip_package_dependencies_resolution: true, output_directory: Dir.pwd + "/test_output" - ) + ) end lane :ui_tests do From 7dbcf63cac6ef227a9d32a2b1a2c378fd952ca10 Mon Sep 17 00:00:00 2001 From: Niall Quinn Date: Thu, 16 May 2024 17:12:26 +0200 Subject: [PATCH 38/42] Cleanup --- fastlane/IOSFastFile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/fastlane/IOSFastFile b/fastlane/IOSFastFile index ef9517ac3..c6b9b861a 100644 --- a/fastlane/IOSFastFile +++ b/fastlane/IOSFastFile @@ -30,18 +30,8 @@ platform :ios do ###################### PUBLIC LANES ####################### - lane :tests do |options| + lane :tests do common_pre_build_action - sim_version = options[:sim_version] || "17.2" - # run_tests(workspace: app_workspace, - # scheme: "example_0_70_6Tests", - # sdk: "iphonesimulator#{sim_version}", - # destination: "os=#{sim_version},name=iPhone 14 Plus", - # result_bundle: true, - # code_coverage: true, - # skip_package_dependencies_resolution: true, - # output_directory: Dir.pwd + "/test_output" - # ) run_tests(workspace: app_workspace, scheme: "example_0_70_6Tests", From 8f58e555357b21abfe749dbac01ee11f8147c570 Mon Sep 17 00:00:00 2001 From: Semir Date: Fri, 17 May 2024 09:44:20 +0200 Subject: [PATCH 39/42] chore: updated sonar sources --- .../xcshareddata/xcschemes/example_0_70_6Tests.xcscheme | 2 +- sonar-project.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme index 5053476d7..54875dd82 100644 --- a/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme +++ b/packages/example/ios/example_0_70_6.xcodeproj/xcshareddata/xcschemes/example_0_70_6Tests.xcscheme @@ -1,7 +1,7 @@ + version = "1.8"> Date: Fri, 17 May 2024 09:58:06 +0200 Subject: [PATCH 40/42] chore: updated sonar sources --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index 7b60f32b3..b3d67bb35 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,10 +7,10 @@ sonar.sourceEncoding=UTF-8 # Source settings sonar.sources=packages/sdk/ -sonar.tests = packages/sdk/, package/examples/ios/example_0_70_6_Tests/ +sonar.tests = packages/sdk/, packages/example/ios/example_0_70_6_Tests/ # Include test subdirectories in test scope -sonar.test.inclusions = packages/sdk/**/test/**/*, packages/sdk/**/__tests__/**/*, package/examples/ios/example_0_70_6_Tests/**/*.swift +sonar.test.inclusions = packages/sdk/**/test/**/*, packages/sdk/**/__tests__/**/*, packages/example/ios/example_0_70_6_Tests/**/*.swift # Exclusions sonar.exclusions=**/jest.config.js,packages/example/**,packages/sdk/**/test/**/*, packages/sdk/**/__tests__/**/* From 3519903089771f062351ab6b1a8e2d5ddb745148 Mon Sep 17 00:00:00 2001 From: Semir Date: Fri, 17 May 2024 10:11:27 +0200 Subject: [PATCH 41/42] chore: updated sonar sources --- sonar-project.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sonar-project.properties b/sonar-project.properties index b3d67bb35..78d8274a5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,10 +7,10 @@ sonar.sourceEncoding=UTF-8 # Source settings sonar.sources=packages/sdk/ -sonar.tests = packages/sdk/, packages/example/ios/example_0_70_6_Tests/ +sonar.tests = packages/sdk/, packages/example/ios/example_0_70_6Tests/ # Include test subdirectories in test scope -sonar.test.inclusions = packages/sdk/**/test/**/*, packages/sdk/**/__tests__/**/*, packages/example/ios/example_0_70_6_Tests/**/*.swift +sonar.test.inclusions = packages/sdk/**/test/**/*, packages/sdk/**/__tests__/**/*, packages/example/ios/example_0_70_6Tests/**/*.swift # Exclusions sonar.exclusions=**/jest.config.js,packages/example/**,packages/sdk/**/test/**/*, packages/sdk/**/__tests__/**/* From e5a10667de439722b455a525f1f1a66456c42408 Mon Sep 17 00:00:00 2001 From: Semir Date: Fri, 17 May 2024 14:05:20 +0200 Subject: [PATCH 42/42] chore: remove Gemfile duplication --- Gemfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Gemfile b/Gemfile index f7a4c11a9..1ec7f8afd 100644 --- a/Gemfile +++ b/Gemfile @@ -8,6 +8,3 @@ gem "cocoapods" plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'PluginFile') eval_gemfile(plugins_path) if File.exist?(plugins_path) - -plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') -eval_gemfile(plugins_path) if File.exist?(plugins_path)