Skip to content

Latest commit

 

History

History

testing-sdk

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

📚 Documentation   •   🖥️ Application   •   🏠 Home

Setup

Install Autoblocks CLI

See Autoblocks CLI documentation

Install dependencies

npm install

Run Autoblocks tests

Set your Autoblocks API key

Retrieve your local testing API key from the settings page and set it as an environment variable:

export AUTOBLOCKS_API_KEY=...

Set your OpenAI API key

export OPENAI_API_KEY=...

Run the tests

npx autoblocks testing exec -m "my first run" -- npm run start

You should see something like:

Screenshot 2024-03-01 at 5 53 27 PM

You can click on the links next to each test name to dig into more details. You can also find all of your tests on the testing homepage in the Autoblocks application.

GitHub Actions setup

A starter workflow was added in .github/workflows/autoblocks-testing.yml. This workflow runs the tests on every push to the repository and also on a daily schedule.

Repo structure

src/
  run.ts <-- imports all tests from test-suites/ and runs them
  evaluators/ <-- all common evaluators are implemented here
    some-shared-evaluator1.ts
    some-shared-evaluator2.ts
  tasks/ <-- all "tasks" are implemented here
    task1.ts
    task2.ts
  test-suites/ <-- tests for each task
    task1/
      index.ts <-- implements the runner for task1
      evaluators.ts  <-- evaluators used only for task1
      test-cases.ts <-- contains test cases for task1
    task2/
      index.ts <-- implements the runner for task2
      evaluators.ts  <-- evaluators used only for task2
      test-cases.ts <-- contains test cases for task2

Futher Reading