Skip to content

fix failed tests in apitest (move_cart and stat)#1376

Merged
KernelDeimos merged 2 commits intoHeyPuter:mainfrom
XiaochenCui:apitest-fix
Jul 29, 2025
Merged

fix failed tests in apitest (move_cart and stat)#1376
KernelDeimos merged 2 commits intoHeyPuter:mainfrom
XiaochenCui:apitest-fix

Conversation

@XiaochenCui
Copy link
Copy Markdown
Contributor

@XiaochenCui XiaochenCui commented Jul 24, 2025

This is a continuation of PR #1369

Originally, there were 5 failed test in apitest:

> node ./tools/api-tester/apitest.js --config=./tools/api-tester/config.yml --unit

=== Test Results ===
┌─────────────────────────────────┬────────┬────────┬───────┐
│ (index)                         │ passed │ failed │ total │
├─────────────────────────────────┼────────┼────────┼───────┤
│ Cartesian Test for /write       │ 24     │ 0      │ 24    │
│ Cartesian Test for /move        │ 44     │ 4      │ 48    │
│ Cartesian Test for /copy        │ 144    │ 0      │ 144   │
│ write and read                  │ 6      │ 0      │ 6     │
│ move                            │ 4      │ 0      │ 4     │
│ stat                            │ 133    │ 1      │ 134   │
│ readdir                         │ 115    │ 0      │ 115   │
│ mkdir                           │ 22     │ 0      │ 22    │
│ batch                           │ 4      │ 0      │ 4     │
│ delete                          │ 7      │ 0      │ 7     │
│ single write for trace and span │ 0      │ 0      │ 0     │
└─────────────────────────────────┴────────┴────────┴───────┘

This PR fixed all the failed tests:

> node ./tools/api-tester/apitest.js --config=./tools/api-tester/config.yml --unit

=== Test Results ===
┌─────────────────────────────────┬────────┬────────┬───────┐
│ (index)                         │ passed │ failed │ total │
├─────────────────────────────────┼────────┼────────┼───────┤
│ Cartesian Test for /write       │ 24     │ 0      │ 24    │
│ Cartesian Test for /move        │ 48     │ 0      │ 48    │
│ Cartesian Test for /copy        │ 144    │ 0      │ 144   │
│ write and read                  │ 6      │ 0      │ 6     │
│ move                            │ 4      │ 0      │ 4     │
│ stat                            │ 134    │ 0      │ 134   │
│ readdir                         │ 115    │ 0      │ 115   │
│ mkdir                           │ 23     │ 0      │ 23    │
│ batch                           │ 4      │ 0      │ 4     │
│ delete                          │ 7      │ 0      │ 7     │
│ single write for trace and span │ 0      │ 0      │ 0     │
└─────────────────────────────────┴────────┴────────┴───────┘
509 tests were run - ✔ All tests passed!

and made some update to apitest:

  • sophisticate document for apitest
  • introduce terminologies test case and *test suite", which is the idea of GoogleTest
  • add --suite=<suite-name> argument

@XiaochenCui XiaochenCui marked this pull request as draft July 24, 2025 00:38
@XiaochenCui XiaochenCui marked this pull request as ready for review July 24, 2025 00:53
@XiaochenCui
Copy link
Copy Markdown
Contributor Author

This PR is ready for review and merge, as long as the pending reviews are resolved.

Copy link
Copy Markdown
Contributor

@KernelDeimos KernelDeimos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'll merge this as soon as I understand why the fix for stat works - it doesn't look like it should change anything

if (return_subdomains) await subject.fetchSubdomains(user)
if (return_permissions) await subject.fetchShares();
if (return_permissions) {
subject.entry.permissions = [];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this fix the test? It looks like FSNodeContext.fetchShares does not try to access or create any property called permissions on the raw entry.

@XiaochenCui
Copy link
Copy Markdown
Contributor Author

All apitests passed, this PR is ready for review/merge

@KernelDeimos
Copy link
Copy Markdown
Contributor

Thanks, I'm merging this now. I think apitest is a great place to put end-to-end tests for invoking LLMs through Puter's API. We can actually test Puter AI at two different layers:

  • API, which is the easiest to do through apitest currently because it already interacts with HTTP endpoints
  • puter.js, which actually wasn't possible before but @ProgrammerIn-wonderland recently made puter.js compatible with node so we can actually include it for fully end-to-end tests

Before we can do either of these I created a prerequisite task for formalizing the input/output formats for Puter AI. Can you work on this next?

@KernelDeimos KernelDeimos merged commit dea6069 into HeyPuter:main Jul 29, 2025
4 checks passed
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