Skip to content

Conversation

ByteWanderer25
Copy link

Hello 👋

I've refactored the hb_volume and dev_volume to limit the nesting

Copy link

@jyeshe jyeshe left a comment

Choose a reason for hiding this comment

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

It's great that it handles external processes execution with Ports and that the sequences are more clear.
I think we should just implement integration tests (some tests without mocking) because the check_for_device expects a Device and it's passing a Partition. This would help catching other regressions.

@jyeshe
Copy link

jyeshe commented Sep 24, 2025

hey @ByteWanderer25 , I started by using the check_device_availability and got an error because of this

rogerio@Rogerios-MacBook-Pro HyperBEAM_kamil % erl
Erlang/OTP 27 [erts-15.2.7.1] [source] [64-bit] [smp:14:14] [ds:14:14:10] [async-threads:1] [jit]

Eshell V15.2.7.1 (press Ctrl+G to abort, type help(). for help)
1> {filelib:is_file("text"), filelib:is_file("/dev/disk4s1")}.
{true,false}

How about using the hb_volume functions that are indirectly called by handle_mounting_partition such as check_device_exists?

1> hb_volume:check_for_device(~"/dev/disk4s1").
{ok,true}

@ByteWanderer25
Copy link
Author

Updated to integration test to use hb_volume:check_for_device/1 and merged the upstream - thank you

@jyeshe
Copy link

jyeshe commented Sep 24, 2025

after rebar3 clean (to have the env var respected) and sudo /bin/zsh -c "HB_ENABLE_DESTRUCTIVE_DISK_TESTS=1 rebar3 shell" a more practical result was this:

1> dev_volume_integration_test:run_integration_tests().

Running destructive disk integration tests...
======================== EUnit ========================
undefined
*** test generator dev_volume_integration_test:full_disk_integration_test_/0 failed ***
**in function erlang:binary_to_list/1
  called as binary_to_list("/dev/disk4s1")
in call from hb_volume:check_for_device/1 (/Users/rogerio/Workspace/_arweave/HyperBEAM_kamil/src/hb_volume.erl, line 706)

and letting hb_volume to do the list conversion lead me to:

1> dev_volume_integration_test:run_integration_tests().

Running destructive disk integration tests...
======================== EUnit ========================
undefined
*** test generator dev_volume_integration_test:full_disk_integration_test_/0 failed ***
**in function dev_volume_integration_test:check_device_availability/0 (/Users/rogerio/Workspace/_arweave/HyperBEAM_kamil/src/dev_volume_integration_test.erl, line 60)
in call from dev_volume_integration_test:safety_checks/0 (/Users/rogerio/Workspace/_arweave/HyperBEAM_kamil/src/dev_volume_integration_test.erl, line 46)
in call from dev_volume_integration_test:full_disk_integration_test_/0 (/Users/rogerio/Workspace/_arweave/HyperBEAM_kamil/src/dev_volume_integration_test.erl, line 111)

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