Skip to content
/ naraku Public

naraku (奈落) - API collection for testing go-spectest/spectest

License

Notifications You must be signed in to change notification settings

nao1215/naraku

Repository files navigation

Gosec LinuxUnitTest MacUnitTest WindowsUnitTest reviewdog Coverage

naraku (奈落)

"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.

API Reference

Please see the API Reference.

GET /v1/health

curl -X GET "http://localhost:8080/v1/health" -H  "accept: application/json" | jq .
{
  "name": "naraku",
  "version": "v0.0.1",
  "revision": "79564c979263a1fa893f7d6f2505fb0c26197b4c"
}

GET /v1/ip

$ curl  http://localhost:8080/v1/ip | jq .
{
  "global_ip": "127.0.0.1"  # localhost :)
}

GET /v1/os/:distribution

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

GET /v1/ulid endpoint was implemented by @aqyuki.

curl -X GET http://localhost:8080/v1/ulid | jq .
{
  "ulid": "01HD3107RHMXD5K0R02TVDPZHB"
}

Contribution (How to develop)

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!

Prerequisites

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 

How to execute server

make server

How to execute test

make test

How to add API

  1. 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.
  2. Fork the go-spectest/naraku repository.
  3. Create a new branch in the forked repository.
  4. Implement the API. Writing unit tests is optional; @nao1215 will add unit tests later if they are not provided.
  5. 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

License

This project is licensed under the MIT License - see the LICENSE file for details.

The origin of the name

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?

Star History

Star History Chart

About

naraku (奈落) - API collection for testing go-spectest/spectest

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •