Skip to content

Commit

Permalink
v7.3.5
Browse files Browse the repository at this point in the history
v7.3.5
  • Loading branch information
platschi authored Jul 6, 2023
2 parents 0884b17 + 6702a1c commit e76de75
Show file tree
Hide file tree
Showing 20 changed files with 91 additions and 2,733 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Publish SDK"

on:
release:
types: [published]

jobs:
publish:
name: Publish SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/sdk

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
always-auth: true
node-version: 16.x
registry-url: https://registry.npmjs.org

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: true

- name: Build code
run: pnpm build

- name: Publish
run: |
diff <(npx npm info . --json | jq '."dist-tags".latest') <(cat package.json | jq '.version') || (pnpm publish --no-git-checks --access public)
env:
NPM_TOKEN: ${{ secrets.NODE_TOKEN }}
43 changes: 2 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,51 +82,12 @@ pnpm start

```bash
cd packages/app
pnpm test:unit
pnpm test:jest
```

For unit tests we use a combination of Jest and [React Testing Library](https://testing-library.com/docs/react-testing-library/intro/)

Page tests should be added to the \_\_tests\_\_ folder at the root as it is not possible to co-locate tests and pages in nextjs. Other tests should be co-located in a \_\_tests\_\_ folder next to their related file.

### End-2-End testing

In order to run fully automated end-2-end (e2e) tests Kwenta uses [Synpress](https://github.com/Synthetixio/synpress) (a wrapper around [Cypress](https://www.cypress.io/)).

#### Constraints

The current e2e tests are written to be run on Optimistic Kovan using Chrome as the browser.

#### Setup

- Download and install Google Chrome
- Setup a test wallet on Optimistic Kovan and fund it with plenty of ETH (to pay for gas) and sUSD
- Prior to running the tests you must set the environment variables below in the shell from which npm is started. Unfortunately, at this time other methods to set said environment variables (eg. through `.env.local`) don't work in conjunction with Synpress.

```bash
PRIVATE_KEY=<INSERTPRIVATEKEY>
NETWORK_NAME=OptimisticKovan
RPC_URL=https://kovan.optimism.io
CHAIN_ID=69
BLOCK_EXPLORER=https://kovan-optimistic.etherscan.io
IS_TESTNET=true
```

##### Bash convenience script for setting up the environment

A Bash convenience script [has been made available here](https://gist.github.com/raffiegang/b24a6b97bcd054645abf59be852bc88d).

- Open bash
- Copy the private key of the test wallet into the file `SYNPRESS_PRIVATEKEY` into the same folder location as the script. While using this method, please don't forget to update your .gitignore file to prevent your private key to be leaked.
- Run the following command `source ./synpress-envsetter.sh`

#### Run the tests

```bash
npm run build
npm start
npm run test:e2e:only:tests
```
Page tests should be added to the `testing` folder at the root as it is not possible to co-locate tests and pages in nextjs. Other tests should be co-located in a \_\_tests\_\_ folder next to their related file.

## Contact

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kwenta",
"version": "7.3.4",
"version": "7.3.5",
"description": "Kwenta",
"main": "index.js",
"scripts": {
Expand Down
10 changes: 2 additions & 8 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kwenta/app",
"version": "7.3.4",
"version": "7.3.5",
"scripts": {
"dev": "next",
"build": "next build",
Expand All @@ -9,10 +9,6 @@
"check-types": "tsc --noEmit",
"jest-preview": "jest-preview",
"test:jest": "jest --coverage --detectOpenHandles",
"test:e2e": "start-server-and-test 'pnpm build && pnpm start' http-get://localhost:3000 'synpress run'",
"test:e2e:only:tests": "synpress run",
"test:e2e:open:testrunner": "synpress open",
"test:e2e:ci": "synpress run --group smoke-tests --record --parallel",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable",
"storybook": "storybook dev -p 6006",
Expand All @@ -33,7 +29,7 @@
"@reduxjs/toolkit": "^1.9.5",
"@sentry/browser": "7.57.0",
"@sentry/tracing": "7.57.0",
"@socket.tech/plugin": "1.0.14",
"@socket.tech/plugin": "1.0.15",
"@synthetixio/optimism-networks": "2.74.6",
"@synthetixio/wei": "2.74.4",
"@tanstack/react-table": "8.9.3",
Expand Down Expand Up @@ -90,8 +86,6 @@
"@storybook/react": "7.0.24",
"@svgr/core": "5.5.0",
"@svgr/webpack": "6.3.1",
"@synthetixio/synpress": "3.7.1",
"@testing-library/cypress": "^9.0.0",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "14.0.0",
"@testing-library/react-hooks": "8.0.1",
Expand Down
73 changes: 0 additions & 73 deletions packages/app/testing/e2e/pages/exchange/exchange-page.js

This file was deleted.

9 changes: 0 additions & 9 deletions packages/app/testing/e2e/pages/exchange/header.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/app/testing/e2e/pages/exchange/notifications.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/app/testing/e2e/pages/exchange/onboard.js

This file was deleted.

111 changes: 0 additions & 111 deletions packages/app/testing/e2e/pages/markets/futures-page.js

This file was deleted.

9 changes: 0 additions & 9 deletions packages/app/testing/e2e/pages/markets/header.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/app/testing/e2e/pages/markets/notifications.js

This file was deleted.

6 changes: 0 additions & 6 deletions packages/app/testing/e2e/pages/markets/onboard.js

This file was deleted.

Loading

1 comment on commit e76de75

@vercel
Copy link

@vercel vercel bot commented on e76de75 Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kwenta – ./packages/app

kwenta-git-main-kwenta.vercel.app
kwenta.io
kwenta-kwenta.vercel.app

Please sign in to comment.