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: release-plz:
name: Release-plz name: Release-plz
runs-on: docker runs-on: docker
container:
image:
git.kemitix.net/kemitix/rust:v4.0.1
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Run release-plz release-pr - 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: env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} 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: build:
runs-on: docker runs-on: docker
container:
image:
git.kemitix.net/kemitix/rust:v4.0.1
strategy: strategy:
matrix: matrix:
toolchain: toolchain:
@ -30,27 +26,36 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Ignored Files
run: check-for-ignored
- name: Check TODOs - name: Check TODOs
uses: https://git.kemitix.net/kemitix/forgejo-todo-checker@v1.3.0 uses: kemitix/todo-checker@v1.1.0
- name: Machete - 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 - 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 - 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 - 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 - 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 - 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] ## [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 ## [5.0.0](https://git.kemitix.net/kemitix/kxio/compare/v4.0.1...v5.0.0) - 2024-12-29
### Added ### Added

View file

@ -1,6 +1,6 @@
[package] [package]
name = "kxio" name = "kxio"
version = "5.1.0" version = "5.0.0"
edition = "2021" edition = "2021"
authors = ["Paul Campbell <pcampbell@kemitix.net>"] authors = ["Paul Campbell <pcampbell@kemitix.net>"]
description = "Provides injectable Filesystem and Network resources to make code more testable" description = "Provides injectable Filesystem and Network resources to make code more testable"
@ -11,16 +11,19 @@ exclude = [".cargo_home"]
[lints.rust] [lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tarpaulin_include)'] } 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] [dependencies]
base64 = "0.22" base64 = "0.22"
bytes = "1.8" bytes = "1.8"
derive_more = { version = "1.0", features = ["constructor", "display", "from"] } derive_more = { version = "1.0", features = [
"constructor",
"display",
"from"
] }
http = "1.1" http = "1.1"
path-clean = "1.0" path-clean = "1.0"
reqwest = { version = "0.12", default-features = false, features = [ reqwest = { version = "0.12", features = [ "json" ] }
"json",
"rustls-tls",
] }
url = "2.5" url = "2.5"
tempfile = "3.10" tempfile = "3.10"
tokio = { version = "1.41", features = [ "sync" ] } tokio = { version = "1.41", features = [ "sync" ] }
@ -31,7 +34,10 @@ assert2 = "0.3"
mutants = "0.0" mutants = "0.0"
pretty_assertions = "1.4" pretty_assertions = "1.4"
test-log = "0.2" 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" tokio-test = "0.4"
[package.metadata.bin] [package.metadata.bin]

View file

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

View file

@ -10,12 +10,6 @@ build:
cargo test --example get cargo test --example get
cargo mutants --jobs 4 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: doc-test:
cargo doc cargo doc
cargo test cargo test

View file

@ -53,52 +53,6 @@ async fn test_get_url() {
assert_eq!(response.bytes().await.expect("response body"), "Get OK"); 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] #[tokio::test]
async fn test_post_url() { async fn test_post_url() {
//given //given