Added comprehensive documentation including:
- API.md: REST API reference.
- CLI.md: Command Line Interface usage.
- ARCHITECTURE.md: System design and components.
- DEVELOPMENT.md: Developer guide.
- README.md: Index for the documentation.
This commit adds comprehensive Go docstrings to the `pkg/mining` package,
including `mining.go`, `manager.go`, `manager_interface.go`, and `xmrig.go`.
The docstrings cover all public types, interfaces, functions, and methods,
and include examples where appropriate to illustrate usage.
This change improves the developer experience by making the code easier to
understand and use.
Refactors the existing test suite to use a `_Good`, `_Bad`, and `_Ugly` testing structure. This new format improves the clarity and organization of the tests by distinguishing between happy path scenarios (_Good), expected failures (_Bad), and edge cases (_Ugly).
In addition to reorganizing the existing tests, this change also introduces new `_Bad` test cases to `xmrig_test.go` to cover previously untested failure modes, such as a missing miner binary and an unreachable API. This improves the overall quality and robustness of the test suite.
Corrected the build script in `ui/package.json` to correctly bundle the Angular application. Also updated `pkg/mining/service.go` to serve the correct bundled JavaScript file.
Verified the backend server is running and accessible by testing the Swagger UI endpoint.
Added tests for GetMiner and ListMiners in the manager, and for the GetInfo and Doctor endpoints in the service. This increases the overall test coverage of the pkg/mining package.
Added tests for StartMiner and StopMiner in the manager, increasing test coverage for the pkg/mining package.
Refactored the findMinerBinary function to fall back to the system PATH, making the application more robust and easier to test.
This commit introduces a number of new tests for the `pkg/mining` package,
increasing the overall test coverage from 8.2% to 41.4%.
The following changes were made:
- Added tests for the `XMRigMiner` struct, including its methods for
installation, starting, stopping, and getting stats.
- Added tests for the `Service` layer, including the API endpoints for
listing, starting, stopping, and getting stats for miners.
- Added tests for the `Manager`, including starting and stopping multiple
miners, collecting stats, and getting hashrate history.
- Introduced a `ManagerInterface` to decouple the `Service` layer from the
concrete `Manager` implementation, facilitating testing with mocks.
- Fixed a failing test on Windows by creating a Windows-compatible
dummy executable.
- Improved encapsulation in tests by adding and using getter methods for
private fields.
This commit introduces a number of new tests for the `pkg/mining` package,
increasing the overall test coverage from 8.2% to 40.7%.
The following changes were made:
- Added tests for the `XMRigMiner` struct, including its methods for
installation, starting, stopping, and getting stats.
- Added tests for the `Service` layer, including the API endpoints for
listing, starting, stopping, and getting stats for miners.
- Added tests for the `Manager`, including starting and stopping multiple
miners, collecting stats, and getting hashrate history.
- Introduced a `ManagerInterface` to decouple the `Service` layer from the
concrete `Manager` implementation, facilitating testing with mocks.
- Fixed a failing test on Windows by creating a Windows-compatible
dummy executable.
This commit introduces a number of new tests for the `pkg/mining` package,
increasing the overall test coverage from 8.2% to 40.7%.
The following changes were made:
- Added tests for the `XMRigMiner` struct, including its methods for
installation, starting, stopping, and getting stats.
- Added tests for the `Service` layer, including the API endpoints for
listing, starting, stopping, and getting stats for miners.
- Added tests for the `Manager`, including starting and stopping multiple
miners, collecting stats, and getting hashrate history.
- Introduced a `ManagerInterface` to decouple the `Service` layer from the
concrete `Manager` implementation, facilitating testing with mocks.
- Adds a `test` job to the `release.yml` workflow that runs on a matrix of operating systems (Linux, macOS, Windows).
- The `release` job is now dependent on the `test` job.
- The workflow is now triggered on every push, but the `release` job only runs on tag pushes.
- Adds a `test-release` target to the `Makefile` to run tests and cross-compile the binaries for all platforms.
- Updates the `release.yml` workflow to use the new `test-release` target.
- Adds a step to the `test` job to upload the coverage report to Codecov.
- Reorganizes the badges in the `README.md` file.
- Adds a `test-release` target to the `Makefile` to run tests and cross-compile the binaries for all platforms.
- Updates the `release.yml` workflow to use the new `test-release` target before the `GoReleaser` action.
- Adds a step to the `release.yml` workflow to upload the coverage report to Codecov.
- Reorganizes the badges in the `README.md` file.