Skip to content

Commit

Permalink
chore: extract dummy-apps to tests folder and scaffold tests folder
Browse files Browse the repository at this point in the history
  • Loading branch information
valpinkman committed Oct 24, 2023
1 parent 52d2725 commit be77d92
Show file tree
Hide file tree
Showing 43 changed files with 3,995 additions and 1,815 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test-mobile-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ jobs:
aws-secret-key: ${{ secrets.SECRET_KEY_BUCKET }}
- name: install dependencies
run: |
pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="dummy-*" --no-frozen-lockfile --unsafe-perm
pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="dummy-*-app..." --no-frozen-lockfile --unsafe-perm
- name: Build dependencies
run: |
pnpm build:llm:deps --api="http://127.0.0.1:${{ steps.turborepo-cache-server.outputs.port }}" --token="yolo" --team="foo"
- name: Build Dummy Live SDK and Dummy Wallet API apps for testing
run: |
pnpm test-utils dummy-apps:build
pnpm build:dummy-apps
shell: bash
- name: Create iOS simulator
id: simulator
Expand Down Expand Up @@ -198,13 +198,13 @@ jobs:
aws-secret-key: ${{ secrets.SECRET_KEY_BUCKET }}
- name: Install dependencies
run: |
pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="dummy-*" --no-frozen-lockfile --unsafe-perm
pnpm i --filter="live-mobile..." --filter="ledger-live" --filter="dummy-*-app..." --no-frozen-lockfile --unsafe-perm
- name: Build dependencies
run: |
pnpm build:llm:deps --api="http://127.0.0.1:${{ steps.turborepo-cache-server.outputs.port }}" --token="yolo" --team="foo"
- name: Build Dummy Live SDK and Dummy Wallet API apps for testing
run: |
pnpm test-utils dummy-apps:build
pnpm build:dummy-apps
shell: bash
- name: Build Android app for Detox test run
run: |
Expand Down
3 changes: 1 addition & 2 deletions apps/ledger-live-desktop/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ src/renderer/families/generated.ts
tests/coverage/
tests/artifacts/*
!tests/artifacts/.gitkeep
tests/utils/dummy-live-app/build
tests/utils/dummy-wallet-app/build


# Yalc
.yalc
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/tests/specs/market/market.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test.use({ userdata: "skip-onboarding" });
let testServerIsRunning = false;

test.beforeAll(async () => {
// Check that dummy app in libs/test-utils/dummy-ptx-app has been started successfully
// Check that dummy app in tests/dummy-ptx-app has been started successfully
testServerIsRunning = await LiveAppWebview.startLiveApp("dummy-ptx-app/public", {
name: "Buy App",
id: "multibuy-v2",
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/tests/specs/services/buy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test.use({
let testServerIsRunning = false;

test.beforeAll(async () => {
// Check that dummy app in libs/test-utils/dummy-ptx-app has been started successfully
// Check that dummy app in tests/dummy-ptx-app has been started successfully
testServerIsRunning = await LiveAppWebview.startLiveApp("dummy-ptx-app/public", {
name: "Buy App",
id: "multibuy-v2",
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/tests/specs/services/earn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test.use({
let testServerIsRunning = false;

test.beforeAll(async () => {
// Check that dummy app in libs/test-utils/dummy-ptx-app has been started successfully
// Check that dummy app in tests/dummy-ptx-app has been started successfully
testServerIsRunning = await LiveAppWebview.startLiveApp("dummy-ptx-app/public", {
name: "Earn",
id: "earn",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test.use({ userdata: "1AccountBTC1AccountETH" });
let testServerIsRunning = false;

test.beforeAll(async () => {
// Check that dummy app in libs/test-utils/dummy-live-app has been started successfully
// Check that dummy app in tests/dummy-live-app has been started successfully
testServerIsRunning = await LiveAppWebview.startLiveApp("dummy-live-app/build", {
name: "Dummy Live App",
id: "dummy-live-app",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ test.use({ userdata: "1AccountBTC1AccountETH" });
let testServerIsRunning = false;

test.beforeAll(async () => {
// Check that dummy app in libs/test-utils/dummy-live-app has been started successfully
// Check that dummy app in tests/dummy-live-app has been started successfully
testServerIsRunning = await LiveAppWebview.startLiveApp("dummy-wallet-app/build", {
name: "Dummy Wallet API Live App",
id: "dummy-live-app",
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/e2e/specs/wallet-api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe("Wallet API methods", () => {
liveAppWebview = new LiveAppWebview();
cryptoDrawer = new CryptoDrawer();

// Check that dummy app in tests/utils/dummy-app-build has been started successfully
// Check that dummy app in tests/dummy-app-build has been started successfully
continueTest = await liveAppWebview.startLiveApp("dummy-wallet-app", 52619);

if (!continueTest || !isAndroid()) {
Expand Down
4 changes: 1 addition & 3 deletions libs/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
"types": "lib/index.d.ts",
"scripts": {
"clean": "rimraf lib lib-es",
"build": "tsc && tsc -m ES6 --outDir lib-es",
"dummy-apps:build": "pnpm --filter='dummy-live-app' --filter='dummy-wallet-app' build",
"dummy-apps:start-ptx-app": "cd dummy-ptx-app && npx http-server"
"build": "tsc && tsc -m ES6 --outDir lib-es"
},
"dependencies": {
"@ledgerhq/live-common": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion libs/test-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const dummyAppServer: http.Server = http.createServer(
// More details here: https://github.com/vercel/serve-handler#options

handler(request, response, {
public: path.resolve(__dirname, "..", dummyAppPath),
public: path.resolve(__dirname, "..", "..", "..", "tests", dummyAppPath),
});
},
);
Expand Down
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"release": "changeset publish",
"build:libs": "pnpm turbo build --no-daemon --filter=\"./libs/**\" --filter=\"!./libs/ui/examples/**\"",
"build:libs:force": "pnpm -r --filter=\"./libs/**\" --filter=\"!./libs/ui/examples/**\" build",
"build:tests": "pnpm turbo build --no-daemon --filter=\"./tests/**\"",
"build:dummy-apps": "pnpm turbo build --filter=\"dummy-*-app\"",
"build:dummy-wallet-app": "pnpm turbo build --filter=\"dummy-wallet-app\"",
"build:dummy-live-app": "pnpm turbo build --filter=\"dummy-live-app\"",
"build:actions": "pnpm turbo build --filter=@actions/*",
"build:cli": "pnpm turbo build --no-daemon --filter=live-cli",
"build:coin": "pnpm turbo build --no-daemon --filter=\"./libs/coin-**\"",
Expand Down Expand Up @@ -101,8 +105,10 @@
"ljs:types-devices": "pnpm --filter types-devices",
"ljs:types-live": "pnpm --filter types-live",
"test-utils": "pnpm --filter test-utils",
"test-utils:dummy-live-app": "pnpm --filter dummy-live-app",
"test-utils:dummy-wallet-app": "pnpm --filter dummy-wallet-app",
"tests": "pnpm --filter=\"./tests/**\"",
"dummy-live-app": "pnpm --filter dummy-live-app",
"dummy-wallet-app": "pnpm --filter dummy-wallet-app",
"dummy-ptx-app": "pnpm --filter dummy-ptx-app",
"ui": "pnpm --filter ui",
"ui:react": "pnpm --filter react-ui",
"ui:native": "pnpm --filter native-ui",
Expand Down
Loading

0 comments on commit be77d92

Please sign in to comment.