Compare commits

..

No commits in common. "main" and "v5.0.0" have entirely different histories.
main ... v5.0.0

7 changed files with 42 additions and 104 deletions

View file

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

View file

@ -7,23 +7,6 @@ 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.1.0"
version = "5.0.0"
edition = "2021"
authors = ["Paul Campbell <pcampbell@kemitix.net>"]
description = "Provides injectable Filesystem and Network resources to make code more testable"
@ -11,16 +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", default-features = false, features = [
"json",
"rustls-tls",
] }
reqwest = { version = "0.12", features = [ "json" ] }
url = "2.5"
tempfile = "3.10"
tokio = { version = "1.41", features = [ "sync" ] }
@ -31,7 +34,10 @@ 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,8 +151,6 @@ 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,12 +10,6 @@ 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,52 +53,6 @@ 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