Skip to content

Commit

Permalink
Merge branch 'master' into Rupato/358/reload--previous-tab-on-refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
hirad-deriv committed Jul 10, 2023
2 parents 934db65 + 55d23ae commit 037006f
Show file tree
Hide file tree
Showing 546 changed files with 88,553 additions and 37,524 deletions.
9 changes: 8 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ commands:
- "packages/trader/node_modules"
- "packages/translations/node_modules"
- "packages/utils/node_modules"
- "packages/analytics/node_modules"
# VERIFY_CACHE_FOLDERS_END (DO NOT REMOVE)

build:
Expand Down Expand Up @@ -251,7 +252,7 @@ jobs:
build_and_test:
docker:
- image: cimg/node:18.16.0
resource_class: xlarge
resource_class: large
steps:
- git_checkout_from_cache
- npm_install_from_cache
Expand All @@ -264,6 +265,9 @@ jobs:
- run:
name: "Check TypeScript for @deriv/utils"
command: npx tsc --project packages/utils/tsconfig.json -noEmit
- run:
name: "Check TypeScript for @deriv/analytics"
command: npx tsc --project packages/analytics/tsconfig.json -noEmit
- run:
name: "Check TypeScript for @deriv/stores"
command: npx tsc --project packages/stores/tsconfig.json -noEmit
Expand All @@ -276,6 +280,9 @@ jobs:
- run:
name: "Check tests for @deriv/utils"
command: bash ./scripts/check-tests.sh packages/utils/src
- run:
name: "Check tests for @deriv/analytics"
command: bash ./scripts/check-tests.sh packages/analytics/src
- build
- run:
name: "Run tests"
Expand Down
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ module.exports = {
},
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'react/prop-types': 'off',
},
},
{
files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'],
extends: ['plugin:testing-library/react'],
Expand Down Expand Up @@ -178,6 +184,10 @@ module.exports = {
version: 'detect',
},
'import/resolver': {
typescript: {
// use an array
project: 'packages/**/tsconfig.json',
},
node: {
extensions: ['.ts', '.tsx'],
moduleDirectory: ['src', 'node_modules'],
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/automationrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"skip_pending_checks": false,
"skip_slack_integration": false,
"skip_updating_branch": true,
"merge_delay": 120000,
"first_merge_delay": 1200000,
"max_task_count": 15,
"pull_request": {
"checks_timeout": 60000,
"refetch_timeout": 10000,
"refetch_limit": 20,
"checks_limit": 40
},
"circleci": {
"project_slug": "gh/binary-com/deriv-app",
"branch": "master",
"workflow_name": "release_staging"
},
"checks_to_skip": ["/gitguardian/i"]
}
33 changes: 0 additions & 33 deletions .github/workflows/codecov.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on: ["push", "pull_request"]

name: Coveralls

jobs:

build:
name: Reporter
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3

- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Bootstrap, Build, and make test-coverage
run: |
npm ci
npm run bootstrap
npm run build:all
JEST_MAX_WORKERS=3 npm run test:jest
- name: Coveralls
uses: coverallsapp/github-action@v2
50 changes: 50 additions & 0 deletions .github/workflows/merge_and_release_to_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Merge and release to staging
permissions:
pull-requests: write
on:
workflow_dispatch:
inputs:
release_tag_task_url:
description: "Release Tag task URL(e.g. https://app.clickup.com/t/1**/W*-*)"
required: true
skip_circleci_checks:
description: "Skip checking CircleCI workflow"
type: boolean
required: false
skip_pending_checks:
description: "Skip waiting for pull request checks"
type: boolean
required: false

concurrency:
group: release_automation_group

jobs:
release_issues:
permissions: write-all
runs-on: ubuntu-latest
timeout-minutes: 600
steps:
- name: Checkout to repo
uses: actions/checkout@v3
with:
ref: master
- name: Setup node
uses: actions/setup-node@v2
- name: Wait for logs to accumulate
run: |
sleep 10
- name: Release issues in Deriv.app
uses: binary-com/fe-toolbox@v0.0.2
with:
release_tag_task_url: ${{ inputs.release_tag_task_url }}
platform: 'Deriv.app'
config_path: ./.github/workflows/automationrc.json
skip_circleci_checks: ${{ inputs.skip_circleci_checks }}
skip_pending_checks: ${{ inputs.skip_pending_checks }}
CIRCLECI_TOKEN: ${{ secrets.CIRCLECI_TOKEN }}
CLICKUP_API_TOKEN: ${{ secrets.CLICKUP_API_TOKEN }}
SLACK_APP_TOKEN: ${{ secrets.SLACK_APP_TOKEN }}
SLACK_USER_TOKEN: ${{ secrets.SLACK_USER_TOKEN }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"*.{js,jsx,ts,tsx,md,html,css,scss}": "prettier --write",
"*.{js,jsx,ts,tsx}": "npx eslint --fix",
"*.{js,jsx,ts,tsx}": "eslint --fix --config .eslintrc.js",
"*.{css,scss}": "npx stylelint --fix"
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repository contains the various platforms of the Deriv application.
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
![Sonar Tech Debt](https://img.shields.io/sonar/tech_debt/binary-com_deriv-app?server=https%3A%2F%2Fsonarcloud.io)
![Sonar Violations (short format)](https://img.shields.io/sonar/violations/binary-com_deriv-app?server=https%3A%2F%2Fsonarcloud.io)
[![codecov](https://codecov.io/gh/binary-com/deriv-app/branch/dev/graph/badge.svg?token=LClg2rlZ4z)](https://codecov.io/gh/binary-com/deriv-app)
[![Coverage Status](https://coveralls.io/repos/github/binary-com/deriv-app/badge.svg?branch=master)](https://coveralls.io/github/binary-com/deriv-app?branch=master)

**In this document**:

Expand Down
6 changes: 5 additions & 1 deletion end-to-end-test/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ ENDPOINT=<YOUR DESIRED ENDPOINT (QABOX ADDRESS)>
APP_URL=<APP URL(FOR LOCAL MACHINES SHOULD BE `https://localhost.binary.sx`>
QA_EMAIL_INBOX_USER_NAME=<QABOX EVENTS PAGE USERNAME (YOU CAN FIND IN `fe-shared` LASTPASS FOLDER) to sign in on `qaxx.deriv.dev/events`>
QA_EMAIL_INBOX_PASSWORD = <QABOX EVENTS PAGE PASSWORD (YOU CAN FIND IN `fe-shared` LASTPASS FOLDER) to sign in on `qaxx.deriv.dev/events`>
ACCOUNT_RESIDENCE=<COUNTRY NAME TO SET RESIDENCY OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Germany`)>
ACCOUNT_RESIDENCE_HIGH_RISK=<COUNTRY NAME TO SET RESIDENCY OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Germany`)>
ACCOUNT_CITIZENSHIP_HIGH_RISK=<COUNTRY NAME TO SET CITIZENSHIP OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Germany`)>
ACCOUNT_RESIDENCE_LOW_RISK=<COUNTRY NAME TO SET RESIDENCY OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Ecuador`)>
ACCOUNT_CITIZENSHIP_LOW_RISK=<COUNTRY NAME TO SET CITIZENSHIP OF ACCOUNT(SHOULD BE `Capitalize` CASE Like `Ecuador`)>
RISK_LEVEL=low_risk # This stores the risk level that can be either high_risk or low_risk
14 changes: 11 additions & 3 deletions end-to-end-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ To run the End to End test you need to first install playwright on your machine

then

`npx plauwright test` to start the tests to run. (You also can pass `--debug` option to this command to it to run them in headless browser and check them visually separated by different browsers eg. Chromium, Firefox or Edge)
`npx playwright test` to start the tests to run. (You also can pass `--debug` option to this command to it to run them in headless browser and check them visually separated by different browsers eg. Chromium, Firefox or Edge)

`npm run test:e2e` to run the tests from within the root `directory`.

`npm run test:e2e-dev` to run the tests from within the root `directory` with trace enabled and show the test report.

## Project structure

Expand All @@ -30,8 +34,12 @@ It's mandatory to create this file to pass the needed environment variables to t
| 5 | `ENDPOINT` | Endpoint of qabox server | String | \* |
| 6 | `APP_URL` | App URL which tests should run on. Local machine URL is `localhost.binary.sx` | String | \* |
| 7 | `QA_EMAIL_INBOX_USER_NAME` | Username of qabox events page to retrive the signup email and enable the created account (You can find it in the LP under shared-fe folder with the `QA emails login creds` entry name) | String | \* |
| 8 | QA_EMAIL_INBOX_PASSWORD | Password of qabox events page to retrive the signup email and enable the created account (You can find it in the LP under shared-fe folder with the `QA emails login creds` entry name) | String | \* |
| 9 | ACCOUNT_RESIDENCE | Account residence to create account using it | String | \* |
| 8 | `QA_EMAIL_INBOX_PASSWORD` | Password of qabox events page to retrive the signup email and enable the created account (You can find it in the LP under shared-fe folder with the `QA emails login creds` entry name) | String | \* |
| 9 | `ACCOUNT_RESIDENCE_HIGH_RISK` | Account residence to use when creating high risk accounts it | String | \* |
| 10 | `ACCOUNT_RESIDENCE_LOW_RISK` | Account residence to use when creating low risk accounts | String | \* |
| 11 | `ACCOUNT_CITIZENSHIP_HIGH_RISK` | Account citizenship to use when creating high risk accounts | String | \* |
| 12 | `ACCOUNT_CITIZENSHIP_LOW_RISK` | Account citizenship to use when creating low risk accounts | String | \* |
| 13 | `RISK_LEVEL` | Risk level for the particular account i.e. high risk or low risk | String | \* |

### `onboarding.ts` file

Expand Down
82 changes: 0 additions & 82 deletions end-to-end-test/package-lock.json

This file was deleted.

10 changes: 8 additions & 2 deletions end-to-end-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
"keywords": [],
"author": "",
"license": "ISC",
"eslintConfig": {
"rules": {
"testing-library/no-await-sync-query": "off",
"testing-library/prefer-screen-queries": "off"
}
},
"dependencies": {
"@playwright/test": "^1.29.2",
"dotenv": "^16.0.3"
"dotenv": "^16.0.3",
"@playwright/test": "^1.33.0"
}
}
Loading

0 comments on commit 037006f

Please sign in to comment.