"Naraku" is a repository created to assess the quality of End-to-End (E2E) tests using go-spectest/spectest. Spectest is an E2E testing framework, and to confirm its ease of use, it is essential to create test cases for APIs.
I chose to build APIs to test a wide range of API types. If a useful API is created, it will be deployed using Lambda + API Gateway.
Please see the API Reference.
curl -X GET "http://localhost:8080/v1/health" -H "accept: application/json" | jq .
{
"name": "naraku",
"version": "v0.0.1",
"revision": "79564c979263a1fa893f7d6f2505fb0c26197b4c"
}
$ curl http://localhost:8080/v1/ip | jq .
{
"global_ip": "127.0.0.1" # localhost :)
}
Currently, the android, debian distributions are supported.
$ curl -X GET http://localhost:8080/v1/os/android | jq .
{
"items": [
{
"name": "Android",
"version": "1.0",
"release": "2008-09-23T00:00:00Z",
"api_level": [
1
]
},
{
"name": "Android",
"version": "1.1",
"release": "2009-02-09T00:00:00Z",
"api_level": [
2
]
},
{
"name": "Android",
"version": "1.5",
"code_name": "Cupcake",
"release": "2009-04-27T00:00:00Z",
"api_level": [
3
]
},
...
}
GET /v1/ulid
endpoint was implemented by @aqyuki.
curl -X GET http://localhost:8080/v1/ulid | jq .
{
"ulid": "01HD3107RHMXD5K0R02TVDPZHB"
}
Thank you for expressing your willingness to contribute. Contribution is not limited to code modifications alone. If you can provide a simple API specification, there is a possibility of implementing its features. Also, your star on the project repository serves as a source of motivation for our development efforts!
You need to install the following tools to develop this project.
Category | Technology |
---|---|
DB Accessor | sqlc |
Swagger generator | echo-swagger |
ER diagram | tbls |
Test framework | ginkgo |
Dependency Injection | wire |
Build Tools | make |
Please install make and Golang using package managers, and other Golang-based tools can be installed using the following command.
make install-tools
make server
make test
- Choose a proposal for the API you want to create from the Issues section. If there isn't a proposal for the API you want to create, please create a new Issue.
- Fork the go-spectest/naraku repository.
- Create a new branch in the forked repository.
- Implement the API. Writing unit tests is optional; @nao1215 will add unit tests later if they are not provided.
- Create a Pull Request.
At this stage, please refrain from creating APIs that connect to databases or AWS. Initially, @nao1215 will implement sample code for connecting to DB and AWS.
I expect the APIs you create to be small in scale. You can write the API entry points in the api directory and the corresponding logic within the api
package. The APIs should be small enough that it is acceptable to write the logic within the `api`` package
This project is licensed under the MIT License - see the LICENSE file for details.
The name "Naraku" was borrowed from a character in the series InuYaSha. Naraku is a being formed by the accumulation of numerous demons around a human. The inspiration for the name comes from the way multiple APIs gather in the spectest framework. Naraku is a half-demon with excellent defensive abilities. I also hope that these characteristics will manifest in spectest.
Moreover, "Naraku" also means falling into hell. Don't you think creating and testing numerous APIs can be challenging?