Skip to content

Conversation

@dasormeter
Copy link
Contributor

No description provided.

@dasormeter
Copy link
Contributor Author

dasormeter commented Dec 6, 2025

Moving back to DRAFT -- one integration test is failing

  1 failed
    [workflow] › tests/workflow.spec.ts:39:7 › AppInstall and Licensing workflow › AppProvider can cancel an AppInstall
  15 passed (50.8s)

Instructions

  • Following Playwright test failed.
  • Explain why, be concise, respect Playwright best practices.
  • Provide a snippet of code with the fix, if possible.

Test info

  • Name: AppInstall and Licensing workflow >> AppProvider can cancel an AppInstall
  • Location: workflow.spec.ts:39:7

Stdout

Using test tag: test-1765043420233-4
Creating user with tag: test-1765043420233-4
Get Admin Token app-user-validator
Ledger party created with id: test-1765043420233-4-app-user::1220454e8837f4ebe8eb49f223cd08cdbed03d92449447563cb6dbcc0adecc317fb1
Keycloak user created with id: cc072868-a434-4f8e-bda5-9d269ba87cbe
Ledger user created with id: cc072868-a434-4f8e-bda5-9d269ba87cbe for party: test-1765043420233-4-app-user::1220454e8837f4ebe8eb49f223cd08cdbed03d92449447563cb6dbcc0adecc317fb1
Grant rights user:cc072868-a434-4f8e-bda5-9d269ba87cbe party:test-1765043420233-4-app-user::1220454e8837f4ebe8eb49f223cd08cdbed03d92449447563cb6dbcc0adecc317fb1
Run create-app-install-request shell script.
✓ Docker is installed and running
docker compose -f docker/create-app-install-request/compose.yaml --env-file .env --env-file .env.local --env-file /Users/brianhealey/g/cn-quickstart/quickstart/docker/modules/localnet/compose.env --env-file /Users/brianhealey/g/cn-quickstart/quickstart/docker/modules/localnet/env/common.env --env-file /Users/brianhealey/g/cn-quickstart/quickstart/docker/modules/keycloak/compose.env --env-file /Users/brianhealey/g/cn-quickstart/quickstart/docker/modules/pqs/compose.env   run --rm container
#1 [internal] load local bake definitions
#1 reading from stdin 673B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 332B 0.0s done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/sgaunet/jwt-cli:latest
#3 ...

#4 [auth] sgaunet/jwt-cli:pull token for registry-1.docker.io
#4 DONE 0.0s

#5 [auth] library/alpine:pull token for registry-1.docker.io
#5 DONE 0.0s

#6 [internal] load metadata for docker.io/library/alpine:3.21
#6 ...

#3 [internal] load metadata for docker.io/sgaunet/jwt-cli:latest
#3 DONE 0.6s

#6 [internal] load metadata for docker.io/library/alpine:3.21
#6 DONE 0.6s

#7 [internal] load .dockerignore
#7 transferring context: 2B done
#7 DONE 0.0s

#8 [jwtcli 1/1] FROM docker.io/sgaunet/jwt-cli:latest@sha256:f49f1b56f810b7c61c0085dc5457a1fb0bfb77b98e0954bb6d6db53617ef1452
#8 resolve docker.io/sgaunet/jwt-cli:latest@sha256:f49f1b56f810b7c61c0085dc5457a1fb0bfb77b98e0954bb6d6db53617ef1452 0.0s done
#8 DONE 0.0s

#9 [stage-1 1/3] FROM docker.io/library/alpine:3.21@sha256:5405e8f36ce1878720f71217d664aa3dea32e5e5df11acbf07fc78ef5661465b
#9 resolve docker.io/library/alpine:3.21@sha256:5405e8f36ce1878720f71217d664aa3dea32e5e5df11acbf07fc78ef5661465b 0.0s done
#9 DONE 0.0s

#10 [stage-1 2/3] COPY --from=jwtcli /jwt-cli /usr/bin/jwt-cli
#10 CACHED

#11 [stage-1 3/3] RUN apk add --no-cache jq curl bash
#11 CACHED

#12 exporting to image
#12 exporting layers done
#12 exporting manifest sha256:d6c57d15d5e897059378a26fb5465428048dbc5409e422dd5976e1b90187c657 done
#12 exporting config sha256:a22e849d0ce5dea0bbe7b9d7f57de5c0a5c0fafe204cdb7246e1f0722c4307c4 done
#12 exporting attestation manifest sha256:6877aee98adba257a3816be11117a25b56e78eb49c0ab59a6c9aeb87764cec6c
#12 exporting attestation manifest sha256:6877aee98adba257a3816be11117a25b56e78eb49c0ab59a6c9aeb87764cec6c 0.0s done
#12 exporting manifest list sha256:1ddb00b7ca24732cb3b1aeda95a56b224f975ca45e0bb0b79e636e1b0d92966b 0.0s done
#12 naming to docker.io/library/create-app-install-request-container:latest done
#12 ERROR: image "docker.io/library/create-app-install-request-container:latest": already exists
------
 > exporting to image:
------

Stderr

failed to solve: image "docker.io/library/create-app-install-request-container:latest": already exists

make[1]: *** [Makefile:215: create-app-install-request] Error 1

Error details

Error: Command failed: make --no-print-directory create-app-install-request

   at ../utils/appUserSetup.ts:63

  61 |
  62 |     const timeoutMs = Number(process.env.CREATE_APP_INSTALL_REQUEST_TIMEOUT_MS) || 1 * 30 * 1000; // default 30 seconds
> 63 |     execFileSync('make', ['--no-print-directory', 'create-app-install-request'], {
     |                 ^
  64 |       cwd: resolve(__dirname, '../..'),
  65 |       env,
  66 |       stdio: 'inherit',
    at AppUserSetup.createAppInstallRequest (/Users/brianhealey/g/cn-quickstart/quickstart/integration-test/utils/appUserSetup.ts:63:17)
    at /Users/brianhealey/g/cn-quickstart/quickstart/integration-test/fixtures/workflow.ts:40:20
    at Object.requestTag (/Users/brianhealey/g/cn-quickstart/quickstart/integration-test/fixtures/workflow.ts:39:16)

Test source

   1 | import type {APIRequestContext} from 'playwright-core';
   2 | import TagProvider from '../fixtures/workflow';
   3 | import {execFileSync} from 'child_process';
   4 | import {resolve} from 'path';
   5 | import {Keycloak} from './keycloak';
   6 | import {createParty, createUser as createLedgerUser, grantRights} from './ledger';
   7 |
   8 |
   9 | export default class AppUserSetup {
  10 |   request: APIRequestContext;
  11 |   tagProvider: TagProvider;
  12 |   userName!: string;
  13 |   userId!: string;
  14 |   partyId!: string;
  15 |
  16 |   private constructor(request: APIRequestContext, tagProvider: TagProvider) {
  17 |     this.request = request;
  18 |     this.tagProvider = tagProvider;
  19 |   }
  20 |
  21 |   static async create(request: APIRequestContext, keycloak: Keycloak, tagProvider: TagProvider): Promise<AppUserSetup> {
  22 |     const instance = new AppUserSetup(request, tagProvider);
  23 |     const tag = tagProvider.base;
  24 |
  25 |     console.log(`Creating user with tag: ${tag}`);
  26 |     const secret = process.env.AUTH_APP_USER_VALIDATOR_CLIENT_SECRET!
  27 |     const clientId = process.env.AUTH_APP_USER_VALIDATOR_CLIENT_ID!
  28 |     const partyIdHint = `${tag}-${process.env.APP_USER_PARTY_HINT || 'app-user'}`;
  29 |     const participant = 'localhost:2' + process.env.PARTICIPANT_JSON_API_PORT_SUFFIX;
  30 |
  31 |     // 0. Get admin token for the app user participant
  32 |     const adminToken = await keycloak.getAdminToken(secret, clientId)
  33 |
  34 |     // 1. Create a new ledger party
  35 |     instance.partyId = await createParty(request, adminToken, partyIdHint, participant);
  36 |
  37 |     // 2. Create a new keycloak user
  38 |     instance.userId = await keycloak.createUser(instance.partyId, tag);
  39 |
  40 |     // 3. Create a new ledger user
  41 |     await createLedgerUser(request, adminToken, instance.userId, tag, instance.partyId, participant);
  42 |
  43 |     // 4. Grant rights to the user
  44 |     await grantRights(request, adminToken, instance.userId, instance.partyId, "ReadAs ActAs", participant);
  45 |
  46 |     instance.userName = `app-user-${tag}`;
  47 |     return instance;
  48 |   }
  49 |
  50 |   public createAppInstallRequest(uniqueRequestTag: string) {
  51 |     const env = {
  52 |       ...process.env,
  53 |       TEST_UNIQUE_REQUEST_TAG: uniqueRequestTag,
  54 |       TEST_MODE: 'on',
  55 |       TEST_AUTH_APP_USER_WALLET_ADMIN_USER_NAME: this.userName,
  56 |       TEST_AUTH_APP_USER_WALLET_ADMIN_USER_ID: this.userId,
  57 |       TEST_APP_USER_PARTY: this.partyId
  58 |     };
  59 |
  60 |     console.log(`Run create-app-install-request shell script.`);
  61 |
  62 |     const timeoutMs = Number(process.env.CREATE_APP_INSTALL_REQUEST_TIMEOUT_MS) || 1 * 30 * 1000; // default 30 seconds
> 63 |     execFileSync('make', ['--no-print-directory', 'create-app-install-request'], {
     |                 ^ Error: Command failed: make --no-print-directory create-app-install-request
  64 |       cwd: resolve(__dirname, '../..'),
  65 |       env,
  66 |       stdio: 'inherit',
  67 |       timeout: timeoutMs,
  68 |       killSignal: 'SIGKILL',
  69 |     });
  70 |
  71 |     console.log(`AppInstallRequest created with tag: ${uniqueRequestTag}`);
  72 |   }
  73 | }
  74 |
  75 | //

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants