Skip to content

atelet: add successful RPC boundary tests#469

Open
Yiqing Wang (YQ-Wang) wants to merge 1 commit into
agent-substrate:mainfrom
YQ-Wang:feat/issue-217-atelet-rpc-tests
Open

atelet: add successful RPC boundary tests#469
Yiqing Wang (YQ-Wang) wants to merge 1 commit into
agent-substrate:mainfrom
YQ-Wang:feat/issue-217-atelet-rpc-tests

Conversation

@YQ-Wang

Copy link
Copy Markdown
Contributor

Summary

  • make ateom client dialing and image pulling injectable
  • allow atelet filesystem paths to be redirected in tests
  • cover a successful local Run, Checkpoint, and Restore lifecycle at the RPC boundary

Testing

  • go test ./cmd/atelet ./internal/ateompath
  • go test ./...

Closes #217

@YQ-Wang
Yiqing Wang (YQ-Wang) force-pushed the feat/issue-217-atelet-rpc-tests branch from 089f487 to 711e3bb Compare July 22, 2026 04:55
@YQ-Wang

Copy link
Copy Markdown
Contributor Author

Dmitry Berkovich (@dberkov) ptal, thanks!

Comment thread cmd/atelet/main_test.go Outdated
Comment thread cmd/atelet/main_test.go
Comment thread cmd/atelet/oci.go Outdated
Comment thread cmd/atelet/main_test.go Outdated
@YQ-Wang
Yiqing Wang (YQ-Wang) force-pushed the feat/issue-217-atelet-rpc-tests branch 2 times, most recently from 6f40c26 to 02ab98b Compare July 23, 2026 07:48

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

minor comment, could you please fix it.

Comment thread internal/ateompath/ateompath.go Outdated
// BasePath is both the path of the root shared folder on the host filesystem,
// and where it is mounted into ateom and atelet containers. It is a variable
// so tests can redirect filesystem operations to a temporary directory.
var BasePath = "/var/lib/ateom-gvisor"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

making mutable global variable might introduce issues. Can it stay const or could you make it Method too, similar to StaticFilesDir()?

@YQ-Wang Yiqing Wang (YQ-Wang) Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I kept BasePath constant and added an instance-local path mapper for tests, so they no longer mutate global state.

@YQ-Wang
Yiqing Wang (YQ-Wang) force-pushed the feat/issue-217-atelet-rpc-tests branch from 02ab98b to 9c32828 Compare July 25, 2026 04:39

@BenTheElder Benjamin Elder (BenTheElder) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are we injecting a full fake filesystem? If not, this isn't really a unit test, these methods may interact with other paths than ateom-path.

Ordinarily I'm all for test coverage ... but I'm not sure I understand what sort of bugs we intend to catch with this, while we're making the code more indirect.

I don't think we should "unit" test main(). And I'm not sure integration testing atelet makes much sense (vs e2e with ateom).

EDIT: keep in mind atelet now also does things like mount for OCI layers, which is not at all unit-test like, and I think it will be unnecessarily complex to fake out interfaces like this.

@YQ-Wang

Yiqing Wang (YQ-Wang) commented Jul 25, 2026

Copy link
Copy Markdown
Contributor Author

Are we injecting a full fake filesystem? If not, this isn't really a unit test, these methods may interact with other paths than ateom-path.

Ordinarily I'm all for test coverage ... but I'm not sure I understand what sort of bugs we intend to catch with this, while we're making the code more indirect.

I don't think we should "unit" test main(). And I'm not sure integration testing atelet makes much sense (vs e2e with ateom).

Benjamin Elder (@BenTheElder) Thanks for the feedback. Following #217, the goal was to cover atelet’s request handling and local checkpoint/restore flow. I checked the existing e2e suite and confirmed that it already covers the Run, Checkpoint, and Restore lifecycle with real atelet and ateom. Given that coverage, I agree the additional test seam may not justify the added indirection.

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.

Expand validation test coverage at atelet's RPC layer

3 participants