-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1446 from zhyd1997/ci/ticket-889-1700974455106
ci: fixed detox tests.
- Loading branch information
Showing
19 changed files
with
204 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
# Use the latest 2.1 version of CircleCI pipeline process engine. | ||
# See: https://circleci.com/docs/configuration-reference | ||
version: 2.1 | ||
|
||
orbs: | ||
# The Node.js orb contains a set of prepackaged CircleCI configuration you can utilize | ||
# Orbs reduce the amount of configuration required for common tasks. | ||
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/node | ||
node: circleci/[email protected] | ||
macos: circleci/macos@2 | ||
|
||
jobs: | ||
# Below is the definition of your job to build and test your app, you can rename and customize it as you want. | ||
generate: | ||
# These next lines define a Docker executor: https://circleci.com/docs/executor-types/ | ||
# You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub. | ||
# A list of available CircleCI Docker Convenience Images are available here: https://circleci.com/developer/images/image/cimg/node | ||
macos: | ||
xcode: 15.1.0 | ||
environment: | ||
GITHUB_WORKSPACE: '.' | ||
JHI_REACT_NATIVE_APP_NAME: 'JwtHealthPointsApp' | ||
JHI_AUTH_TYPE: 'jwt' | ||
JHI_DTO: 'false' | ||
JHIPSTER_VERSION: 7 | ||
JHI_ENTITY_JDL: 'entities-21points.jdl' | ||
SCRIPT_DIR: ./test/scripts | ||
PLATFORM: ios | ||
JHI_RECORD_VIDEO: ${{ github.event.inputs.recordVideo || 'false' }} | ||
JHI_SCREENSHOTS: ${{ github.event.inputs.screenshots || 'false' }} | ||
# Then run your tests! | ||
# CircleCI will report the results back to your VCS provider. | ||
steps: | ||
# Checkout the code as the first step. | ||
- checkout | ||
- node/install: | ||
node-version: '16' | ||
- run: node --version | ||
- run: git --no-pager log -n 10 --graph --pretty='%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) <%an>%Creset' --abbrev-commit | ||
- run: | ||
name: Install Homebrew | ||
command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
- run: | ||
name: Verify Homebrew installation | ||
command: brew --version && brew update | ||
# - run: | ||
# name: Install Java 11 | ||
# command: brew install java11 && sudo ln -sfn /usr/local/opt/openjdk@11/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-11.jdk | ||
# - run: | ||
# name: Verify Java Version | ||
# command: java --version | ||
- run: | ||
name: 'TOOLS: installing Detox and its dependencies' | ||
command: $SCRIPT_DIR/install-detox.sh | ||
- run: | ||
name: Config git variables | ||
command: $SCRIPT_DIR/git-config.sh | ||
- run: | ||
name: 'TOOLS: install node dependencies' | ||
command: $SCRIPT_DIR/install-node-dependencies.sh | ||
# - node/install-packages: | ||
# # If you are using yarn, change the line below from "npm" to "yarn" | ||
# pkg-manager: npm | ||
- run: | ||
name: 'TOOLS: display tools' | ||
command: $SCRIPT_DIR/display-tools.sh | ||
- run: | ||
name: 'TOOLS: npm install and link in generator-jhipster-react-native' | ||
command: npm i && npm link | ||
- run: | ||
name: 'SETUP: copy the JDL file for the backend and app' | ||
command: $SCRIPT_DIR/copy-jdl-file.sh | ||
- run: | ||
name: 'GENERATING: generate jhipster backend' | ||
command: $SCRIPT_DIR/generate-jhipster-backend.sh | ||
- run: | ||
name: 'GENERATING: generate react-native app' | ||
command: $SCRIPT_DIR/generate-react-native-app.sh | ||
# - macos/preboot-simulator: | ||
# version: "17.0" | ||
# platform: "iOS" | ||
# device: "iPhone 15" | ||
- run: | ||
name: 'TESTING: run detox tests' | ||
command: pwd && ls && $SCRIPT_DIR/run-detox-tests.sh | ||
- run: | ||
name: 'TESTING: rename detox screenshots to a valid filename' | ||
command: $SCRIPT_DIR/rename-detox-screenshots.sh | ||
# Next, the node orb's install-packages step will install the dependencies from a package.json. | ||
# The orb install-packages step will also automatically cache them for faster future runs. | ||
# - node/install-packages: | ||
# # If you are using yarn, change the line below from "npm" to "yarn" | ||
# pkg-manager: npm | ||
|
||
workflows: | ||
# Below is the definition of your workflow. | ||
# Inside the workflow, you provide the jobs you want to run, e.g this workflow runs the build-and-test job above. | ||
# CircleCI will run this workflow on every commit. | ||
# For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/configuration-reference/#workflows | ||
iOS-E2E: | ||
jobs: | ||
- generate | ||
# # - jhipster | ||
# - generate: | ||
# requires: | ||
# - jhipster | ||
# For running simple node tests, you could optionally use the node/test job from the orb to replicate and replace the job above in fewer lines. | ||
# - node/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,9 @@ concurrency: | |
# Cancel intermediate pull request builds | ||
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | ||
jobs: | ||
generate: | ||
applications: | ||
name: e2e-${{ matrix.app_type }}-${{ matrix.jhipster_version }} | ||
runs-on: macos-12 | ||
runs-on: macos-13 | ||
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.pull_request.title, '[skip ci]') && !contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.ref_type, '[tag]')" | ||
timeout-minutes: 90 | ||
strategy: | ||
|
@@ -84,6 +84,9 @@ jobs: | |
name: Config git variables | ||
- run: $SCRIPT_DIR/install-node-dependencies.sh | ||
name: 'TOOLS: install node dependencies' | ||
- uses: maxim-lobanov/setup-xcode@v1 | ||
with: | ||
xcode-version: latest | ||
- uses: nick-invision/[email protected] | ||
name: 'TOOLS: installing Detox and its dependencies' | ||
with: | ||
|
@@ -113,3 +116,19 @@ jobs: | |
${{ runner.workspace }}/${{ matrix.app_type }}/**/* | ||
!${{ runner.workspace }}/${{ matrix.app_type }}/node_modules | ||
!${{ runner.workspace }}/${{ matrix.app_type }}/e2e/Exponent.app | ||
ios-result: | ||
permissions: | ||
contents: none | ||
runs-on: ubuntu-latest | ||
needs: [applications] | ||
if: always() | ||
steps: | ||
- run: | | ||
echo '${{ toJSON(needs) }}' | ||
if ([ 'skipped' == '${{ needs.applications.result }}' ] || [ 'success' == '${{ needs.applications.result }}' ]); then | ||
exit 0 | ||
fi | ||
if [ 'closed' == '${{ github.event.action }}' ]; then | ||
exit 0 | ||
fi | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
{ | ||
"testEnvironment": "./environment", | ||
"rootDir": "..", | ||
"testMatch": ["<rootDir>/e2e/**/*.spec.js"], | ||
"reporters": ["detox/runners/jest/reporter"], | ||
"testEnvironment": "detox/runners/jest/testEnvironment", | ||
"globalSetup": "detox/runners/jest/globalSetup", | ||
"globalTeardown": "detox/runners/jest/globalTeardown", | ||
"testRunner": "jest-circus/runner", | ||
"testTimeout": 300000, | ||
"testRegex": "\\.spec\\.js$", | ||
"reporters": ["detox/runners/jest/streamlineReporter"], | ||
"maxWorkers": 1, | ||
"verbose": true | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.