dxos / gravity

System testing frameworks.
GNU Affero General Public License v3.0
1 stars 1 forks source link

Testing framework #41

Open dmaretskyi opened 3 years ago

dmaretskyi commented 3 years ago

Testing concerns:

alexwykoff commented 3 years ago

Test 1: Teamwork - Messenger 1 document 1 party Vary the number of agents and how chatty they are.

The test should run daily and should be clear when the system stops working.

This can start as manual kickoff, but should be automated over time.

This should test the models instead of Teamwork UI.

dmaretskyi commented 3 years ago

First prototype

import { Orchestrator }  from '@dxos/testing';

test('test', async () => {

   const orchestrator = new Orchestrator();
   await orchestrator.start(); // starts local in-process bot factory, creates a party

   const agent: AgentHandle = await orchestrator.startAgent('./agent.js', { ...some props }); // spawns a bot, adds it to a party

   await agent.send('send chat message', { text: 'FOO' });

   const messages = await agent.send('get chat messages');
})
class TestAgent extends Bot {
  ...

  handleCommand(cmd, props) {
     switch(cmd) {
        case 'send chat message': this.model.send(props.text); break;
        case 'get chat messages': return this.model.messages;
     }
  }
}

new TestAgent(getConfig()).start();
alexwykoff commented 3 years ago

Block/Status: Initial plan is to test messenger model. Messenger model depends on publish to NPM. Publish is gated on @richburdon review.

dmaretskyi commented 3 years ago

Stage 1: Single machine messenger test

Stage 2: Testing in browser

Stage 2.5: Stability

Stage 3: Multi-machine tests

Stage 4: Testing with WNS