1

I'm trying to run the unit tests with local command line console, and with sf apex run test -o my-user-name --synchronous, and it gives me the following error:

Warning: @salesforce/cli update available from 2.13.9 to 2.22.7.

/usr/local/lib/sf/node_modules/@salesforce/plugin-apex/lib/commands/apex/run/test.js:29
            throw messages.createError('apexLibErr', [err.message]);
            ^

SfError [ApexLibErrError]: Unknown error in Apex Library: 403::User not enabled for streaming
    at Messages.createError (/usr/local/lib/sf/node_modules/@salesforce/core/lib/messages.js:393:16)
    at process.<anonymous> (/usr/local/lib/sf/node_modules/@salesforce/plugin-apex/lib/commands/apex/run/test.js:29:28)
    at process.emit (node:events:513:28)
    at process.processEmit [as emit] (/usr/local/lib/sf/node_modules/signal-exit/index.js:199:34)
    at process._fatalException (node:internal/process/execution:149:25)
    at processPromiseRejections (node:internal/process/promises:288:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32) {   cause: undefined,   actions: undefined,   exitCode: 1 }

I've logged in to my org, and I can see that the tests are actually being run and succeeded from my org Setup > Custom Code > Apex Test Execution. So I guess the problem is just that there are some permission that prevents the streaming output of the test results to my local command line console.

Following the instructions here https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_testing.htm

  • I've enabled the following permission in the permission set which is assigned to the user that I'm running the tests of:
    • View Setup and Configuration
    • API Enabled
  • I've also enabled "Enable Streaming API" from Setup > User Interface
  • According to the error code, I've also enabled the read permission for Standard Object Permissions > Push Topic on the Profile of the user.

Anybody know what I'm still missing?

Thank you!

1 Answer 1

0

The issues was resolved by enabling "Access Libraries" in Permission Set -> System Permissions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .