tesults 1.0.0

Upload test results to Tesults
Documentation
# tesults

Rust library for uploading test results to [Tesults](https://www.tesults.com).

## Installation

Add to your `Cargo.toml`:

```toml
[dependencies]
tesults = "1"
```

## Usage

```rust
use tesults::{Case, Data};

fn main() {
    let tc = Case {
        name:   "Test 1".into(),
        suite:  "Suite A".into(),
        result: "pass".into(),
        ..Default::default()
    };

    let data = Data {
        target: "your-target-token".into(),
        cases:  vec![tc],
        ..Default::default()
    };

    let r = tesults::upload(data);
    println!("Success: {}", r.success);
    println!("Message: {}", r.message);
    println!("Warnings: {}", r.warnings.len());
    println!("Errors: {}", r.errors.len());
}
```

## API

### `tesults::upload(data: Data) -> Response`

#### `Case` fields

| Field        | Type                        | Required | Description                         |
|--------------|-----------------------------|----------|-------------------------------------|
| name         | String                      | yes      | Test case name                      |
| result       | String                      | yes      | `"pass"`, `"fail"`, or `"unknown"`  |
| suite        | String                      | no       | Suite / group name                  |
| desc         | String                      | no       | Description                         |
| reason       | String                      | no       | Failure reason                      |
| raw_result   | String                      | no       | Raw result from the framework       |
| start        | i64                         | no       | Start time — ms since epoch         |
| end          | i64                         | no       | End time — ms since epoch           |
| files        | Vec\<String\>               | no       | Absolute paths to files to upload   |
| params       | HashMap\<String, String\>   | no       | Parametrised test values            |
| custom       | HashMap\<String, String\>   | no       | Custom fields (stored with `_` prefix) |
| steps        | Vec\<Step\>                 | no       | Test steps                          |

#### `Step` fields

| Field  | Type   | Description              |
|--------|--------|--------------------------|
| name   | String | Step name                |
| result | String | `"pass"`, `"fail"`, or `"unknown"` |
| desc   | String | Step description         |
| reason | String | Failure reason           |

#### `Response` fields

| Field    | Type          | Description                    |
|----------|---------------|--------------------------------|
| success  | bool          | `true` if upload succeeded     |
| message  | String        | Status message                 |
| warnings | Vec\<String\> | File upload warnings           |
| errors   | Vec\<String\> | Upload errors                  |

## License

MIT