Compare commits

..

10 commits
v5.0.0 ... main

Author SHA1 Message Date
ForgeJo Action. See: https://git.kemitix.net/kemitix/rust
43fa1c68f3 chore: release v5.1.0
All checks were successful
Test / build (map[name:nightly]) (push) Successful in 4m55s
Test / build (map[name:stable]) (push) Successful in 5m35s
Release Please / Release-plz (push) Successful in 1m11s
Signed-off-by: ForgeJo Action. See: https://git.kemitix.net/kemitix/rust <action@git.kemitix.net>
2025-01-18 17:39:40 +00:00
5c7201abe7 feat: replace openssl with rustls
All checks were successful
Test / build (map[name:stable]) (push) Successful in 4m54s
Test / build (map[name:nightly]) (push) Successful in 5m33s
Release Please / Release-plz (push) Successful in 13s
2025-01-18 17:23:15 +00:00
Renovate Bot
4d546ee57c chore(deps): update git.kemitix.net/kemitix/rust docker tag to v4
All checks were successful
Test / build (map[name:nightly]) (push) Successful in 6m54s
Test / build (map[name:stable]) (push) Successful in 7m16s
Release Please / Release-plz (push) Successful in 13s
2025-01-16 11:59:43 +00:00
2df1cfe11f build: use check-for-ignored
All checks were successful
Test / build (map[name:nightly]) (push) Successful in 3m20s
Test / build (map[name:stable]) (push) Successful in 3m54s
Release Please / Release-plz (push) Successful in 8s
2025-01-14 07:18:13 +00:00
Renovate Bot
18a253e433 chore(deps): update git.kemitix.net/kemitix/rust docker tag to v3.1.0
Some checks are pending
Test / build (map[name:nightly]) (pull_request) Successful in 3m24s
Test / build (map[name:stable]) (pull_request) Successful in 3m49s
Release Please / Release-plz (push) Successful in 8s
Test / build (map[name:nightly]) (push) Waiting to run
Test / build (map[name:stable]) (push) Waiting to run
2025-01-13 23:03:14 +00:00
59fa127967 build: check for ignored files being included in repo
All checks were successful
Test / build (map[name:nightly]) (push) Successful in 3m19s
Test / build (map[name:stable]) (push) Successful in 3m52s
Release Please / Release-plz (push) Successful in 9s
2025-01-13 08:33:32 +00:00
2e5c80875e build: upgrade kemitix/rust v3
All checks were successful
Test / build (map[name:nightly]) (push) Successful in 3m23s
Test / build (map[name:stable]) (push) Successful in 4m31s
Release Please / Release-plz (push) Successful in 18s
2025-01-12 14:12:46 +00:00
Renovate Bot
ad173c17ee chore(deps): update https://git.kemitix.net/kemitix/rust action to v2.6.0
All checks were successful
Test / build (map[name:nightly]) (pull_request) Successful in 3m32s
Test / build (map[name:stable]) (pull_request) Successful in 4m51s
Release Please / Release-plz (push) Successful in 8s
Test / build (map[name:nightly]) (push) Successful in 3m41s
Test / build (map[name:stable]) (push) Successful in 4m40s
2025-01-11 20:43:01 +00:00
Renovate Bot
4206289a10 chore(deps): update https://git.kemitix.net/kemitix/rust action to v2.5.1
Some checks failed
Test / build (map[name:nightly]) (pull_request) Successful in 5m1s
Test / build (map[name:stable]) (pull_request) Successful in 5m47s
Release Please / Release-plz (push) Successful in 34s
Test / build (map[name:nightly]) (push) Failing after 48s
Test / build (map[name:stable]) (push) Successful in 5m58s
2025-01-09 17:42:54 +00:00
a91dcb3a4a tests(net): add explicit tests for assert_no_unused_plans
All checks were successful
Test / build (map[name:stable]) (push) Successful in 8m14s
Test / build (map[name:nightly]) (push) Successful in 8m23s
Release Please / Release-plz (push) Successful in 1m23s
2024-12-29 22:07:41 +00:00
7 changed files with 104 additions and 42 deletions

View file

@ -16,21 +16,23 @@ jobs:
release-plz:
name: Release-plz
runs-on: docker
container:
image:
git.kemitix.net/kemitix/rust:v4.0.1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run release-plz release-pr
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
with:
args: release-plz release-pr --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Run release-plz release
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
with:
args: release-plz release --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }}
run: release-plz release-pr --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Run release-plz release
run: release-plz release --backend gitea --git-token ${{ secrets.FORGEJO_TOKEN }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

View file

@ -16,6 +16,10 @@ jobs:
build:
runs-on: docker
container:
image:
git.kemitix.net/kemitix/rust:v4.0.1
strategy:
matrix:
toolchain:
@ -26,36 +30,27 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Ignored Files
run: check-for-ignored
- name: Check TODOs
uses: kemitix/todo-checker@v1.1.0
uses: https://git.kemitix.net/kemitix/forgejo-todo-checker@v1.3.0
- name: Machete
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
with:
args: ${{ matrix.toolchain.name }} cargo machete
run: cargo +${{ matrix.toolchain.name }} machete
- name: Format
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
with:
args: ${{ matrix.toolchain.name }} cargo fmt --all -- --check
run: cargo +${{ matrix.toolchain.name }} fmt --all --check
- name: Clippy
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
with:
args: ${{ matrix.toolchain.name }} cargo hack --feature-powerset clippy
run: cargo +${{ matrix.toolchain.name }} hack --feature-powerset clippy
- name: Build
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
with:
args: ${{ matrix.toolchain.name }} cargo hack --feature-powerset build
run: cargo +${{ matrix.toolchain.name }} hack --feature-powerset build
- name: Test
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
with:
args: ${{ matrix.toolchain.name }} cargo hack --feature-powerset test
run: cargo +${{ matrix.toolchain.name }} hack --feature-powerset test
- name: Mutations
uses: https://git.kemitix.net/kemitix/rust@v2.5.0
with:
args: ${{ matrix.toolchain.name }} cargo mutants -vV --in-place
run: cargo +${{ matrix.toolchain.name }} mutants -vV --in-place

View file

@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [5.1.0](https://git.kemitix.net/kemitix/kxio/compare/v5.0.0...v5.1.0) - 2025-01-18
### Added
- replace openssl with rustls
### Other
- *(deps)* update git.kemitix.net/kemitix/rust docker tag to v4
- use check-for-ignored
- *(deps)* update git.kemitix.net/kemitix/rust docker tag to v3.1.0
- check for ignored files being included in repo
- upgrade kemitix/rust v3
- *(deps)* update https://git.kemitix.net/kemitix/rust action to v2.6.0
- *(deps)* update https://git.kemitix.net/kemitix/rust action to v2.5.1
- *(net)* add explicit tests for assert_no_unused_plans
## [5.0.0](https://git.kemitix.net/kemitix/kxio/compare/v4.0.1...v5.0.0) - 2024-12-29
### Added

View file

@ -1,6 +1,6 @@
[package]
name = "kxio"
version = "5.0.0"
version = "5.1.0"
edition = "2021"
authors = ["Paul Campbell <pcampbell@kemitix.net>"]
description = "Provides injectable Filesystem and Network resources to make code more testable"
@ -11,22 +11,19 @@ exclude = [".cargo_home"]
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] }
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
base64 = "0.22"
bytes = "1.8"
derive_more = { version = "1.0", features = [
"constructor",
"display",
"from"
] }
derive_more = { version = "1.0", features = ["constructor", "display", "from"] }
http = "1.1"
path-clean = "1.0"
reqwest = { version = "0.12", features = [ "json" ] }
reqwest = { version = "0.12", default-features = false, features = [
"json",
"rustls-tls",
] }
url = "2.5"
tempfile = "3.10"
tokio = { version = "1.41", features = [ "sync" ] }
tokio = { version = "1.41", features = ["sync"] }
tracing = "0.1"
[dev-dependencies]
@ -34,10 +31,7 @@ assert2 = "0.3"
mutants = "0.0"
pretty_assertions = "1.4"
test-log = "0.2"
tokio = { version = "1.41", features = [
"macros",
"rt-multi-thread"
] }
tokio = { version = "1.41", features = ["macros", "rt-multi-thread"] }
tokio-test = "0.4"
[package.metadata.bin]

View file

@ -151,6 +151,8 @@ mod tests {
assert_eq!(contents, "contents");
net.assert_no_unused_plans();
// not needed for this test, but should it be needed, we can avoid checking for any
// unconsumed request matches.
// let mock_net = kxio::net::MockNet::try_from(net).expect("recover mock");

View file

@ -10,6 +10,12 @@ build:
cargo test --example get
cargo mutants --jobs 4
test-in-docker:
docker run --rm -v $PWD:/app/ git.kemitix.net/kemitix/rust:latest cargo test
shell-in-docker:
docker run --rm -it -v $PWD:/app/ git.kemitix.net/kemitix/rust:latest bash
doc-test:
cargo doc
cargo test

View file

@ -53,6 +53,52 @@ async fn test_get_url() {
assert_eq!(response.bytes().await.expect("response body"), "Get OK");
}
#[tokio::test]
async fn test_when_all_plans_match_assert_is_ok() {
//given
let mock_net = kxio::net::mock();
let url = "https://www.example.com";
mock_net
.on()
.get(url)
.respond(StatusCode::OK)
.body("Get OK")
.expect("mock");
let net = Net::from(mock_net);
//when
let _response = net.get(url).send().await.expect("response");
//then
net.assert_no_unused_plans();
}
#[tokio::test]
#[should_panic]
async fn test_when_not_all_plans_match_assert_fails() {
//given
let mock_net = kxio::net::mock();
let url = "https://www.example.com";
mock_net
.on()
.get(url)
.respond(StatusCode::OK)
.body("Get OK")
.expect("mock");
let net = Net::from(mock_net);
//when
// request is not made
// let _response = net.get(url).send().await.expect("response");
//then
net.assert_no_unused_plans();
}
#[tokio::test]
async fn test_post_url() {
//given