All Projects → gavrilaf → chuck

gavrilaf / chuck

Licence: Apache-2.0 license
Lightweight proxy for REST API mocking and run integration test on mobile devices

Programming Languages

go
31211 projects - #10 most used programming language
python
139335 projects - #7 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to chuck

Mockttp
Powerful friendly HTTP mock server & proxy
Stars: ✭ 346 (+1935.29%)
Mutual labels:  integration-testing, mock-server
Stubby4j
An HTTP stub server for testing application interactions with web services (REST, etc) & external system stubbing for easy testing
Stars: ✭ 300 (+1664.71%)
Mutual labels:  integration-testing, mock-server
pactum
REST API Testing Tool for all levels in a Test Pyramid
Stars: ✭ 190 (+1017.65%)
Mutual labels:  integration-testing, mock-server
Smocker
Smocker is a simple and efficient HTTP mock server and proxy.
Stars: ✭ 465 (+2635.29%)
Mutual labels:  integration-testing, mock-server
Prototype.Forms.Controls
This sample app contains a random mixture of Xamarin/Xamarin.Forms controls, views, and functionality snippets that I've created.
Stars: ✭ 21 (+23.53%)
Mutual labels:  mobile-app
Social-Dating-iOS-App
📱 pH7 Social Dating iOS App allows you to use pH7CMS through an easy-going and intuitive iOS webview app. Core is 100% open source and as always contributions are welcome
Stars: ✭ 22 (+29.41%)
Mutual labels:  mobile-app
market-catalog-mobile-app
This project is Mobile App of Aktuel Listesi. Developed by React Native & Redux and Visual Studio AppCenter
Stars: ✭ 36 (+111.76%)
Mutual labels:  mobile-app
software-systems-architecture
A collection of descriptions of the architecture that various systems use.
Stars: ✭ 24 (+41.18%)
Mutual labels:  mobile-app
react-native-tab-bars
Fully customizable navigation tab bar for React Native
Stars: ✭ 16 (-5.88%)
Mutual labels:  mobile-app
wiremock
A tool for mocking HTTP services
Stars: ✭ 5,239 (+30717.65%)
Mutual labels:  mock-server
ngx-testbedder
CLI tool for writing the test bed for Angular integration test
Stars: ✭ 13 (-23.53%)
Mutual labels:  integration-testing
showcase
A Full Stack Journey with Micro Services and Micro Front Ends. Using dapr, kubernetes, react module federation and web assembly,
Stars: ✭ 45 (+164.71%)
Mutual labels:  integration-testing
ideabag2
Idea Bag 2 provides programmers of all proficiency levels ideas for pet projects to work on when they are looking to increase their proficiency in a particular programming language.
Stars: ✭ 51 (+200%)
Mutual labels:  mobile-app
Mung-React
leaning react
Stars: ✭ 13 (-23.53%)
Mutual labels:  mobile-app
NScenario
Dead simple library for annotating steps of test case scenarios.
Stars: ✭ 58 (+241.18%)
Mutual labels:  integration-testing
QtMobileApp
This repository contains basic template for Qt for mobile app development using QML and C++ as backend to access RESTful API's
Stars: ✭ 16 (-5.88%)
Mutual labels:  mobile-app
SwiftYFinance
The best Yahoo Finance library with the power of Swift
Stars: ✭ 30 (+76.47%)
Mutual labels:  mobile-app
lemmur
🐒 A mobile client for lemmy
Stars: ✭ 228 (+1241.18%)
Mutual labels:  mobile-app
actix sqlx mysql user crud
A user crud written in Rust, designed to connect to a MySQL database with full integration test coverage.
Stars: ✭ 78 (+358.82%)
Mutual labels:  integration-testing
Endpoint2mock
Android library which simplifies mocking of Retrofit endpoints
Stars: ✭ 16 (-5.88%)
Mutual labels:  mock-server

chuck

The proxy server for mobile application debugging, mocking nonexisting API, record and run integration tests.

Installation

  1. Install go MacOS using brew: brew install go Other operation systems: https://golang.org/doc/install

  2. Clone chuck repository: git clone https://github.com/gavrilaf/chuck.git

Chuck uses golang modules so you don't need to clone Chuck repo to the GOPATH directory. Clone Chuck anywhere. But if you clone Chuck to the GOPATH folder then setup GO111MODULE=on environment variable. Or build and run Chuck using makefile as described below.

  1. Load dependencies, build & check chuck: make test from the Chuck folder This command build the project and run all unit tests. All tests should be passed.

How to use

Before run you have to install certificate from the project folder as root certificate (or generate and install new one).

Chuck supports 4 modes:

Record mode

chuck rec [-address=addr] [-port=port] [-folder=folder] [-new_folder] [-prevent_304] [-focused] In this mode, the application is working as a transparent proxy but all traffic is saved to the disk.

Debug mode

Just copy logs recorded in the rec mode to another folder. Make some requests focused (changed 'N' on 'F' in the index.txtx file), edit according responses and run Chuck in the debug mode.

chuck dbg [-address=addr] [-port=port] [-folder=folder]

Chuck runs as a transparent proxy but for the focused requests will be returned stored values. Also, you are able to add new requests to the index.txt. It's a very simple way how to stub unexisting REST API.

Integration tests recording mode

Almost the same with recording mode but with scenarios support.

chuck intg_rec [-address=addr] [-port=port] [-folder=folder] [-new_folder] [-prevent_304]

The tested application should call endpoint https://chuck-url/scenario/scenario_id/app_id/no before any scenario execution. All following requests will be stored to the folder 'scenario_id'. app_id isn't used right now.

Example The application generates requests.

https://chuck-url/scenario/sc-12/123/no
https://some-endpoint-1
https://some-endpoint-2
https://chuck-url/scenario/sc-674/123/no
https://some-endpoint-1
https://some-endpoint-4

Chuck creates following log.

root
  |----sc-12
  |       |-----index.txt (some-endpoint-1, some-endpoint-2)
  |
  |----sc-674
  |       |-----index.txt (some-endpoint-1, some-endpoint-4)

All requests are logged as focused.

Integration tests playing mode

chuck intg_rec [-address=addr] [-port=port] [-folder=folder]

After recording scenarios using recording mode Chuck is able to play it. The tested application should call endpoint https://chuck-url/scenario/scenario_id/app_id/no before any scenario execution. Each request should contains 'int-test-identifier = app_id' in the http header. Chuck uses this header to determine which scenario is active for this application.

Using make

make run-rec/run-dgb/run-intg/run-intg-rec is running Сhuck in different modes with default parameters.

How to generate new root certificates

Install self signed certificates on iOS simulator

  1. Launch Safari in the simulator.
  2. Drag’n’Drop ‘ca.pem’ file into the browser address line.
  3. Install certificate (press "Allow"/"Done"/"Install" on all questions)
  4. Navigate to Settings > General > About > Certificate Trust Settings
  5. Enable full trust for the new installed certificate

Developing

I hope Chuck is a good example how to write well-formed Golang code and how to use BDD with Golang.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].