Skip to content

Comments

[feature] Implement file.pwd()#1419

Merged
KCarretto merged 5 commits intomainfrom
eldritch-libfile-pwd-9557021610331532511
Dec 27, 2025
Merged

[feature] Implement file.pwd()#1419
KCarretto merged 5 commits intomainfrom
eldritch-libfile-pwd-9557021610331532511

Conversation

@google-labs-jules
Copy link
Contributor

Implemented file.pwd() method in eldritch-libfile to return the current working directory. The method returns Option<str>, where None is returned if the directory cannot be determined. Included implementations for both standard and fake environments, along with a unit test.


PR created automatically by Jules for task 9557021610331532511 started by @KCarretto

Added `pwd` method to `FileLibrary` trait and implementations.
- `lib.rs`: Added `pwd` to trait definition.
- `std.rs`: Implemented `pwd` using `std::env::current_dir`.
- `fake.rs`: Implemented mock `pwd`.
- Added unit test for `pwd`.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 26, 2025

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
2453    ↑677 2453    ↑679 0    ↓2 0    ±0 0    ±0 0    ±0 26.5s    ↓490774h

Previous Results

Build 🏗️ Result 🧪 Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
#3330 2453 2453 0 0 0 0 26.5s
#3328 1776 1774 2 0 0 0 490774h
#3328 2453 2453 0 0 0 0 26.6s
#3327 2225 2222 3 0 0 0 27.3s
#3324 2225 2222 3 0 0 0 26.2s

Insights

Average Tests per Run Total Flaky Tests Total Failed Slowest Test (p95)
2226 0 8 45.8s

Fail Rate

Fail Rate 0.07%    ↓0.02
Test 📝 Results 📊 Passed ✅ Failed ❌ Fail Rate (%) 📈
eldritchv2: bindings_test::test_file_bindings 14 8 6 42.86    ↓11.69
eldritchv2: bindings_test::test_file_bindings 14 8 6 42.86    ↓11.69
eldritchv2: bindings_test::test_file_bindings 14 8 6 42.86    ↓11.69
TestReportFile 5 4 1 20.00    ↓5.00
eldritch: assets::copy_impl::tests::test_embedded_copy 15 14 1 6.67    ↓1.66
eldritch: assets::copy_impl::tests::test_embedded_copy 15 14 1 6.67    ↓1.66
eldritch: assets::copy_impl::tests::test_embedded_copy 15 14 1 6.67    ↓1.66

Failed Tests

No failed tests ✨

Slowest Tests

Test 📝 Results 📊 Duration (avg) ⏱️ Duration (p95) ⏱️
eldritch: random::string_impl::tests::test_string_uniform 14 40.2s 45.8s
eldritch: random::string_impl::tests::test_string_uniform 14 40.2s 45.8s
eldritch: random::string_impl::tests::test_string_uniform 14 40.2s 45.8s
eldritch: pivot::port_scan_impl::tests::test_portscan_return_type_starlark_dict_from_interpreter 14 2.1s 8.7s
eldritch: pivot::port_scan_impl::tests::test_portscan_return_type_starlark_dict_from_interpreter 14 2.1s 8.7s
eldritch: pivot::port_scan_impl::tests::test_portscan_return_type_starlark_dict_from_interpreter 14 2.1s 8.7s
eldritch: process::info_impl::tests::test_info_default 14 1.8s 8.7s
eldritch: process::info_impl::tests::test_info_default 14 1.8s 8.7s
eldritch: process::info_impl::tests::test_info_default 14 1.8s 8.7s
eldritch: pivot::ssh_copy_impl::tests::test_pivot_ssh_copy 14 3.4s 8.7s

🍂 No flaky tests detected across all runs. | ⏱️ Measured over 5 runs.

Github Test Reporter by CTRF 💚

🔄 This comment has been updated

Added `pwd` method to `FileLibrary` trait and implementations.
- `lib.rs`: Added `pwd` to trait definition.
- `std.rs`: Implemented `pwd` using `std::env::current_dir`.
- `fake.rs`: Implemented mock `pwd`.
- Added unit test for `pwd`.
- Updated `eldritch.md` with documentation for `file.pwd`, labeled as `(V2-Only)`.
Added `pwd` method to `FileLibrary` trait and implementations.
- `lib.rs`: Added `pwd` to trait definition.
- `std.rs`: Implemented `pwd` using `std::env::current_dir`.
- `fake.rs`: Implemented mock `pwd`.
- Added unit test for `pwd`.
- Updated `eldritch.md` with documentation for `file.pwd`, labeled as `(V2-Only)`.
- Updated `bindings_test.rs` to verify `file.pwd` is exposed.
@KCarretto
Copy link
Collaborator

Fixes #1419

@KCarretto KCarretto marked this pull request as ready for review December 26, 2025 22:14
@KCarretto KCarretto changed the title Add pwd method to eldritch-libfile [feature] Implement file.pwd() Dec 26, 2025
@google-labs-jules
Copy link
Contributor Author

Fixes #1419

Acknowledged.

Added `pwd` method to `FileLibrary` trait and implementations.
- `lib.rs`: Added `pwd` to trait definition.
- `std.rs`: Implemented `pwd` using `std::env::current_dir`.
- `fake.rs`: Implemented mock `pwd`.
- Added unit test for `pwd`.
- Updated `eldritch.md` with documentation for `file.pwd`, labeled as `(V2-Only)`.
- Updated `bindings_test.rs` to verify `file.pwd` is exposed.
@KCarretto KCarretto requested a review from hulto December 26, 2025 23:13
Copy link
Collaborator

@hulto hulto left a comment

Choose a reason for hiding this comment

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

We should split these out of one file.

@KCarretto KCarretto merged commit 0083b13 into main Dec 27, 2025
6 checks passed
@KCarretto KCarretto deleted the eldritch-libfile-pwd-9557021610331532511 branch December 27, 2025 03:51
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