Skip to content

Commit 2f19625

Browse files
authored
Merge pull request #6 from apitoolkit/Date_Support
Date support, Exports, Directories etc.
2 parents 84d27b2 + 2210c74 commit 2f19625

10 files changed

+1027
-823
lines changed

Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ colored_json = "3"
2929
# TODO: gate the desktop only dependencies behind a feature gate
3030
dioxus = { git = "https://github.com/DioxusLabs/dioxus/" }
3131
dioxus-desktop = { git = "https://github.com/DioxusLabs/dioxus/" }
32+
chrono = "0.4.26"
3233
dioxus-logger = "0.4.1"
34+
walkdir = "2.3.3"
3335
# dioxus-web = { git = "https://github.com/DioxusLabs/dioxus/" }
3436
# dioxus-hot-reload = { git = "https://github.com/DioxusLabs/dioxus/" }
3537
# dioxus-hot-reload = "0.1.1"

Examples/README.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Testing Testkit with a Real-World API SPEC
2+
3+
The `realworld.yaml` file contains a Testkit version of the [Real World API SPEC](https://github.com/gothinkster/realworld/blob/main/api/Conduit.postman_collection.json), which allows you to experiment with Testkit and get started quickly.
4+
5+
## Server Setup
6+
7+
Before testing the API SPEC, you need to have a server running to test against. There are various implementations of the `realworld` API SPEC in different languages. To use them as test servers, clone the desired implementation from [here](https://codebase.show/projects/realworld?category=backend), and run it locally.
8+
9+
For the purpose of this guide, we'll walk you through setting up the `Go + Gin` implementation.
10+
11+
### Setting up the Go + Gin Implementation of the Real World API
12+
13+
1. Clone the repository and navigate into the directory:
14+
15+
```shell
16+
git clone https://github.com/gothinkster/golang-gin-realworld-example-app.git
17+
cd golang-gin-realworld-example-app/
18+
```
19+
20+
2. Build the server by running the following commands in the project's root directory:
21+
22+
```shell
23+
go build ./...
24+
```
25+
26+
3. Start the server by executing the generated executable:
27+
28+
```shell
29+
./golang-gin-realworld-example-app
30+
```
31+
32+
Once the server is running, you need to set up the environment variables. You have two options: either set them up in a `.env` file or directly in the `realworld.yaml` Testkit file.
33+
34+
The example test file expects the following environment variables:
35+
36+
- `APIURL`
37+
- `PASSWORD`
38+
- `USERNAME`
39+
- `EMAIL`
40+
41+
To set these environment variables in a `.env` file, create the file and add the necessary values:
42+
43+
```shell
44+
APIURL=https://api.example.com
45+
46+
PASSWORD=mysecretpassword
47+
USERNAME=myusername
48+
```
49+
50+
Now, you are ready to run the test. Execute the following command:
51+
52+
```shell
53+
cargo run -- --file ./Examples/realworld.yaml
54+
```
55+
56+
This will run the Testkit test using the specified `realworld.yaml` file against your locally running Go + Gin implementation of the Real World API. Enjoy exploring and testing with Testkit!

0 commit comments

Comments
 (0)