> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# practitest/firecracker

This orb will help you to connect PractiTest's Firecracker tool. Firecracker will use your test result XML and upload it into your PractiTest project.


## Commands

### fire

This command will get all the configurations for firecracker run
  and execute it.
Firecracker -is a tool to create Testset, Test and Steps in PractiTest
  from XML test results.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `additional_test_fields` | string | \"custom-fields\":{},\"system-fields\":{}
 | add here test fields mapping |
| `additional_testset_fields` | string | \"custom-fields\":{},\"system-fields\":{}
 | add here Testset field mapping |
| `api_token` | env_var_name | FIRE_API_TOKEN | your PAT (personal api token) or your account's api token in Practitest |
| `api_uri` | string | https://api.practitest.com | in case you use eu server of practitest you will need to change it into https://eu1-prod.practitest.app |
| `author_id` | integer |  | user id who will run firecracker (should depend on api token that you use) |
| `email` | string |  | email of the user that will run firecracker |
| `extra_params` | string |  | in case you want to add extra params to json configuration |
| `firecracker_version` | string |  | firecracker version to use |
| `multitestset` | boolean | false | decide if firecracker will create multiple testset or single testset |
| `project_id` | integer |  | project id that firecracker will direct the results to |
| `step_name` | string | ?pt-test-step-name
 | map steps name |
| `test_case_as_pt_test_step` | boolean | true | decide if firecracker will use test-case as practitest steps or tests; true will group testcases into one test and each testcase will be a step |
| `test_folder` | string |  | folder that contains test results |
| `test_name` | string | ?pt-test-name
 | map tests name |
| `testset_name` | string | FirecrackerTestSet | in case of single testset creation choose the name for this testset name |

## Examples

### simple_run

Regular run of firecracker that will, run ruby tests and upload the results to Practitest via Firecracker.
!!!important!!!
In case you don't run your circleci as machine user you will need to add these lines as a step:
- setup_remote_docker:
            version: 19.03.13

before you run your tests (in case they fail).
In case you use EU environment you will need to change api_uri into https://eu1-prod.practitest.app/


```yaml
version: '2.1'
orbs:
  firecracker: practitest/firecracker@1.0.0
jobs:
  build:
    docker:
      - image: circleci/ruby:2.5.5-node
    steps:
      - setup_remote_docker:
          version: 19.03.13
      - run_test:
          command: run test
      - store_test_results:
          path: test_results
      - firecracker/fire:
          api_token: FIRE_API_TOKEN
          author_id: ${FIRE_AUTHOR}
          email: ${FIRE_EMAIL}
          firecracker_version: v2.0.3
          project_id: ${FIRE_PROJECT_ID}
          test_folder: test_results
workflows:
  my-workflow:
    jobs:
      - build:
          context:
            - PT API Token
```