Coder Social home page Coder Social logo

tubbz-alt / bot_army_starter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adobe/bot_army_starter

0.0 1.0 0.0 29 KB

A starting template to set up your own load or integration tests using the bot army

License: MIT License

Elixir 99.31% Shell 0.69%

bot_army_starter's Introduction

Bot Army Starting Template

A starting point for setting up a new bot army. This includes samples for both load testing and integration/functional testing.

See Bot Army Docs on how to use the bot army.

The Bot Army Cookbook is also useful.

Set up

You will need to have Elixir and Erlang installed on your computer/container (asdf works well for this).

Fetch and compile deps with mix do deps.get, deps.compile.

If you want to write your tests in the same repo as the project they are testing, you can mv bot_army_starter your_project/bot_test.

Using

The behavior trees are located in /lib/trees and the actions are in /lib/actions.

The sample load tree imports tree data from a json file created with the Behavior Tree Visual Editor. Download the editor from there and open ./lib/trees/sample_load_bt.json to view and edit the tree.

Follow the examples and the docs to build out your trees and actions. You may also need to add a /lib/bot.ex module if you need to customize the bot (to add websocket syncing for example).

Keep your actions atomic, and use the structure of the trees to describe the logic of your behaviors.

Running locally

You can run the bots locally using the two included mix tasks:

Load test runner

mix bots.load_test --tree BotArmyStarter.Trees.SampleLoad --n 5 --custom '[magic_number: 7]'

You will see some output. Press "q" then "enter" to quit the bots and see a summary of their actions. You can view the full logs at bot_run.log.

For convenience, the above command can also be run with sh lib/trees/run_load.sh (edit that file to change parameters).

Integration test runner

mix test

This will run all of the integration tests in test/ via ExUnit.

Deploying

You can run the bots in a docker container. A sample docker file is provided, but you will need to adjust it (particularly the CMD section).

You can also build a "release" which can be run as an executable. Be aware the release can only run on the same OS it was built on!

Just run mix release, which will build it to _build/prod/rel/bot_army_starter/bin/bot_army_starter.

To run it cd _build/prod/rel/bot_army_starter/ and then run bin/bot_test eval 'BotArmyStarter.Run.run(30)' (See lib/run.ex).

bot_army_starter's People

Contributors

jschomay avatar rfelts avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.