Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
326 stars 206 forks source link

tests in TypeScript (.ts files) lack stack traces #8662

Closed turadg closed 2 months ago

turadg commented 9 months ago

What is the Problem Being Solved?

The boot tests run .ts files in Ava using --loader=tsx. This works but due to the Endo hardening the stack traces lose line numbers. (Transpiled files are treat as being all in one line)

To observe

cd packages/boot
# edit a test file to induce an exception
yarn test yarn test test/bootstrapTests/test-addAssets.ts

See the .ts files in the stack trace all report line 1. E.g.,

  › Node.js v20.11.0
  › runPackageScript (packages/boot/tools/supports.ts:1:2676)
  › async Object.buildAndExtract [as buildProposal] (packages/boot/tools/supports.ts:1:3672)
  › async packages/boot/test/bootstrapTests/test-addAssets.ts:1:435

Description of the Design

https://github.com/endojs/endo/issues/1798 was one hypothesis but may not solve the above.

Security Considerations

n/a

Scaling Considerations

n/a

Test Plan

Verify manually that stack traces have full line numbers.

Upgrade Considerations

n/a

dckc commented 7 months ago

This is impacting me today. Not a big deal, but...

  use IBC callbacks after upgrade
  Value is not truthy:

  undefined

  › packages/boot/test/bootstrapTests/test-vats-restart.ts:1:4790
erights commented 7 months ago

I don't understand what's causing this, so I don't know if #2109 would help.

@turadg @dckc how can I reproduce?

mhofman commented 7 months ago

I know what the problem is. Mark I can walk you through my potential fix this week.

turadg commented 7 months ago

@erights I've added repro steps to the body.

erights commented 2 months ago

This is a bug in endo, not in agoric-sdk. Now filed as https://github.com/endojs/endo/issues/2348 . Feel free to close out this one as subsumed by that one.

erights commented 2 months ago

Thanks for the repro steps! I'll try to reproduce this.

erights commented 2 months ago

I assigned that one to myself. I am also assigning this to myself, and closing this one as subsumed by that one.

turadg commented 2 months ago

I have this problem in agoric-sdk so I'll keep the ticket open until it's solved.

erights commented 2 months ago

Ok. Keep it assigned to me.