Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Upgrade js-ipfsd-ctl to patched 7.1.x #425

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 15 additions & 29 deletions conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,28 @@ $ ./setup.sh

By default, there is a `http` symlink to `../target/debug/ipfs-http`. You can
change this to the release binary by modifying the symlink or use a custom
binary via the environment variable `IPFS_RUST_EXEC`. The default `rust.sh`
wrapper will record all actions taken by the tests into a single large log
file. It's not recommended to trust it to keep all log lines especially for
tests with multiple processes.
binary via the environment variable `IPFS_RUST_EXEC`.

```bash
$ IPFS_RUST_EXEC="$(pwd)/rust.sh" npm test
$ cat /tmp/rust.log
```

## Obtaining logs for tests with multiple processes

Patch the `rust.sh` as follows:
**NOTE**: if you need to invoke `rust-gdb`, remember to do launch it against the
symlink not using the file it points to, otherwise no symbols might get loaded.

```diff
-./http "$@" 2>&1 | tee -a /tmp/rust.log || retval=$?
+./http "$@" 2>&1 | tee -a /tmp/rust.log.$$ || retval=$?
```
**NOTE**: previously we had a `rust.sh` for capturing logs. Turns out it was
unnecessary and even incompatible with the latest behaviour of js-ipfsd-ctl of
sending a SIGKILL to the launched process, which would leave the actual
ipfs-http running while the shell script cannot react. The obtaining logs
section below has been updated to reflect this.

Now the `/tmp/rust.log` will contain only the "pointers" to other log files, for example:

```
>>>> new execution 24132 with args: daemon
<<<< exiting 24132 with 0
```

This means there is now a log file `/tmp/rust.log.24132` for that invocation.
## Obtaining logs for tests with multiple processes

Additionally, it helps to clear out the logs often with `rm -f /tmp/rust.log*`
and only run selected tests using `IPFS_RUST_EXEC="$(pwd)/rust.sh" npm test -- --grep 'should do foo'`.
If it's impossible to limit the number of tests to one with `--grep`, you can
comment out the undesired tests in `test/index.js`.
Use environment variable `DEBUG` with a value of `*` to let js-ipfsd-ctl to
passthrough logs. The same mechanism is used in our CI configuration. However
it might not allow one to know which log output comes from which process, for
one needs to rig the process id to be part of tracing-subscriber output.

# Patch management

We are currently pinned to `[email protected]` and the fixes we have upstreamed are kept under `patches/`.
We are currently pinned to `[email protected]` and the fixes we have
upstreamed are kept under `patches/`.

To create a new patch:

Expand Down
Loading