• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openSUSE / agama / 10526235787 / 3 – rust
71%
master: 72%

Build:
Build:
LAST BUILD BRANCH: storage-volume-keywords
DEFAULT BRANCH: master
Ran 23 Aug 2024 01:13PM UTC
Files 89
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Aug 2024 10:23AM UTC coverage: 25.634%. First build
rust – 10526235787.3

Pull #1548

github

mvidner
test: SoftwareStore::store happy

Note the `when.(...).body("{JSON object}")` part

where the JSON must match what the client sends,
otherwise the mock server will respond with a 404,
and the test will rightly fail with:
```
Error: BackendError(404, "{\"message\":\"Request did not match any route or mock\"}")
```

The problem is that if you compose that JSON according to your best understanding of the client but make a typo, you are still left with that unhelpful 404.

These 3 parts were all need to arrive at a working string:

1. Enable httpmock logging by calling `env_logger::init();` at the start of the test function.
2. Show the request, by enabling the logging at runtime, at the right level: (`test_setting_software` is a partial match on the test name).

```console
(cd rust; RUST_LOG=httpmock=debug cargo test test_setting_software)
```

If you don't like typing, the really important bits are these. httpmock will also log the more detailed Trace level but it does not get in the way
```console
RUST_LOG=httpmock cargo test
```

3. Unfortunately the request will be logged not as text but as an array of bytes shown numerically. [Process the output with this script to extract the text.][extract]

[extract]: https://gist.github.com/mvidner/0e22ea82abecb44b469841929e5ec279#file-httpmock_body-rb
Pull Request #1548: `agama config load`/`store` for "software" uses the HTTP API

1404 of 5477 relevant lines covered (25.63%)

0.77 hits per line

Source Files on job rust - 10526235787.3
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 10526235787
  • d3f2e0be on github
  • Prev Job for on http-client-software (#10468008056.)
  • Next Job for on http-client-software (#10558841592.)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc