Skip to content

Commit

Permalink
ci: fix test-app
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranjamie committed Mar 14, 2024
1 parent c93a5b0 commit 5b5159e
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 62 deletions.
5 changes: 0 additions & 5 deletions .github/actions/provision/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,9 @@ runs:
${{ runner.os }}-pnpm-store-
- uses: nick-fields/retry@v2
if: steps.cache.outputs.cache-hit != 'true'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
with:
timeout_minutes: 5
max_attempts: 3
command: pnpm install --frozen-lockfile

- name: Pandacodegen
run: pnpm panda codegen
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: kyranjamie/[email protected]
with:
header: '> _Building Leather at commit `${{ env.SHORT_SHA }}`_'
header: '> _Building Leather at commit ${{ env.SHORT_SHA }}_'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ jobs:
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV

- uses: actions/cache@v4
id: cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/package.json') }}-${{ env.PLAYWRIGHT_VERSION }}-force

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: pnpm install --frozen-lockfile

- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
Expand Down Expand Up @@ -98,7 +86,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4

- name: Set up pnpm
uses: pnpm/action-setup@v3

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand Down
2 changes: 0 additions & 2 deletions .tool-versions

This file was deleted.

28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use `react-refresh` to update the extension as you work. This gives us near inst
persists the state of the application between changes. To start development mode for the extension, run this command:

```bash
yarn dev
pnpm dev
```

#### Optional: run test app
Expand All @@ -35,13 +35,13 @@ can do.
In a separate terminal, run:

```bash
yarn dev:test-app
pnpm dev:test-app
```

### Loading extension in your browser

You'll need to add it to your browser of choice. Leather only
supports Chromium and Firefox browsers. When you run `yarn dev`, it will compile the application to the `/dist` folder
supports Chromium and Firefox browsers. When you run `pnpm dev`, it will compile the application to the `/dist` folder

- [Chrome instructions](https://developer.chrome.com/docs/extensions/mv3/faq/#faq-dev-01)
- [Firefox instructions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension#trying_it_out)
Expand All @@ -53,13 +53,13 @@ Several testing scripts are available in [`package.json`](./package.json).
The integration tests expect the extension to be built prior to running. The extension can be built for tests with the command below.

```bash
yarn build:test
pnpm build:test
```

The integration tests use Playwright, which requires the system to have the browsers it needs. The following command installs everything Playwright needs.

```bash
yarn playwright install --with-deps
pnpm playwright install --with-deps
```

Note that the installed browsers are tied to the version of Playwright being used, and it may be necessary to run the above command again in some situations, such as when upgrading Playwright or switching branches. [Read the documentation for more information](https://playwright.dev/docs/cli#install-system-dependencies).
Expand All @@ -69,22 +69,22 @@ Note that the installed browsers are tied to the version of Playwright being use
All integration tests can be run using:

```bash
yarn test:integration
pnpm test:integration
```

To run a suite of tests you can use:

```bash
yarn playwright test specs/TEST.spec.ts
yarn playwright test tests/specs --shard=3/8
pnpm playwright test specs/TEST.spec.ts
pnpm playwright test tests/specs --shard=3/8
```

### Unit tests

Unit tests can be run with vitest using:

```bash
yarn test:unit
pnpm test:unit
```

## Production
Expand All @@ -98,7 +98,7 @@ Alternatively, the following steps can be taken by _technical_ users with the la
Run the following from within this repository's root directory if you've pulled it with Git:

```bash
yarn && yarn prepare && yarn build
pnpm && pnpm prepare && pnpm build
```

The extension is now built in the `./dist` folder.
Expand All @@ -108,7 +108,7 @@ The extension is now built in the `./dist` folder.
To build the extension in Firefox mode, the `TARGET_BROWSER=firefox` variable needs to be set.

```bash
yarn && yarn prepare && TARGET_BROWSER=firefox yarn build
pnpm && pnpm prepare && TARGET_BROWSER=firefox pnpm build
```

Note that when building in a clean environment, some code may vary between this and the submitted build. This is because some variables are set within the scope of the production build's CI.
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
},
"dependencies": {
"@bitcoinerlab/secp256k1": "1.0.2",
"@blockstack/stacks-transactions": "0.7.0",
"@coinbase/cbpay-js": "1.0.2",
"@dlc-link/dlc-tools": "1.1.1",
"@fungible-systems/zone-file": "2.0.0",
Expand Down Expand Up @@ -193,6 +194,7 @@
"chroma-js": "2.4.2",
"coinselect": "3.1.13",
"compare-versions": "4.1.3",
"cross-fetch": "4.0.0",
"css-loader": "6.9.0",
"dayjs": "1.11.8",
"dompurify": "3.0.6",
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default defineConfig({
},
],
webServer: {
command: 'yarn dev:test-app',
command: 'pnpm dev:test-app',
port: 3000,
timeout: 15000,
},
Expand Down
14 changes: 14 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions test-app/webpack/webpack.config.base.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const config = {
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
vm: require.resolve('vm-browserify'),
buffer: require.resolve('buffer/'),
},
},
optimization: {
Expand Down
1 change: 0 additions & 1 deletion webpack/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ const aliases = {
'@stacks/storage': '@stacks/storage/dist/esm',
'@stacks/transactions': '@stacks/transactions/dist/esm',
'@stacks/wallet-sdk': '@stacks/wallet-sdk/dist/esm',

'leather-styles': path.resolve('leather-styles'),
};

Expand Down

0 comments on commit 5b5159e

Please sign in to comment.