Skip to content

Commit

Permalink
doc: improve HACKING.md
Browse files Browse the repository at this point in the history
Add some missing dependencies for running unit test and static checks
locally.

Signed-off-by: Chi Wai Chan <[email protected]>
  • Loading branch information
chanchiwai-ray committed Dec 20, 2024
1 parent 2bddc9d commit 3c93057
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ Building MicroCeph is as easy as a snap!
# v for verbose output of the build process.
snapcraft -v
...
Creating snap package
...
Creating snap package
...
Created snap package microceph_0+git.ac1da26_amd64.snap
```
```

The newly created .snap artifact can then be installed as
```bash
# Dangerous flag for locally built snap
sudo snap install --dangerous microceph_*.snap
sudo snap install --dangerous microceph_*.snap
```

```bash
Expand All @@ -85,12 +85,29 @@ sudo snap restart microceph.daemon
```

## 👍 Unit-Testing
The MicroCeph [makefile](/microceph/Makefile) has targets for running unit tests and lint checks. They can be run as follows.
The MicroCeph [Makefile](/microceph/Makefile) has targets for running unit tests and lint checks. However, you will need the following packages or tool to run them locally.

```bash
# Note: commands executed from microceph subdir which contains the Makefile.
# Add general requirements
sudo apt install gcc make shellcheck

# Add libdqlite-dev, required for building microceph
sudo add-apt-repository ppa:dqlite/dev -y
sudo apt install -y libdqlite-dev

# Install go and export the binary to PATH
sudo snap install go --classic
export PATH=$PATH:$HOME/go/bin
```

Once you install the prerequisite, you can run unit tests and lint checks as follows:

```bash
cd microceph

# Run unit tests
make check-unit

# Run static checks
make check-static
```
```

0 comments on commit 3c93057

Please sign in to comment.