Skip to content

Commit

Permalink
[MER-2016] make aviator_api_token an env variable (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
doratzeng authored Mar 23, 2023
1 parent 26ac63b commit 08badbe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
1 change: 0 additions & 1 deletion .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
# Run your orb's commands to validate them.
- run: mkdir test_results && echo "lorem ipsum" > test_results/output.xml
- aviator-upload-orb/upload:
aviator_api_token: 'av_live_xxx'
assets: 'test_results/*.xml'
workflows:
test-deploy:
Expand Down
30 changes: 11 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,23 @@
[![CircleCI Build Status](https://circleci.com/gh/aviator-co/circleci-upload-orb.svg?style=shield "CircleCI Build Status")](https://circleci.com/gh/aviator-co/circleci-upload-orb) [![CircleCI Orb Version](https://badges.circleci.com/orbs/aviator/aviator-upload-orb.svg)](https://circleci.com/orbs/registry/orb/aviator/aviator-upload-orb) [![GitHub License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/aviator-co/circleci-upload-orb/master/LICENSE) [![CircleCI Community](https://img.shields.io/badge/community-CircleCI%20Discuss-343434.svg)](https://discuss.circleci.com/c/ecosystem/orbs)



A project template for Orbs.

This repository is designed to be automatically ingested and modified by the CircleCI CLI's `orb init` command.

## Orb to upload CircleCI artifacts to Aviator
Aviator is a developer productivity platform that helps keep the builds stable at scale. This orb is designed as an extension to the Aviator service that helps upload the test artifacts to Aviator server. Aviator analyzes and catalogs these test artifacts to perform the following functions.:

- Identify flaky test in the system reactively and proactively. Aviator provides APIs and webhooks to report these results
- Historical view of a particular test case - how often it has failed (flaky or not), has it become stable / unstable. Views by feature branches vs base branches.
- Provides visibility whether test stability is degrading or improving for base branches
- Whether test run times are going up or down (understand P50, P90 ,etc of test run times)
- Ability to rerun the test suite at a particular cadence (nightly job) to proactively identify flakes
- Provides visibility whether the test suite is failing because of infra issues (something where we don’t even get a test report) or a real test failure
- Automatically rerun the test suite if the test failed because of infra issue
Aviator is a developer productivity platform that helps keep builds stable at scale. This orb is designed as an extension to the Aviator service that helps upload test artifacts to the Aviator server. Aviator analyzes and catalogs these test artifacts to perform the following functions.:

- Identify flaky tests in the system reactively and proactively. Aviator provides APIs and webhooks to report these results.
- Historical view of a particular test case - how often has the test failed (flaky or not), and has the test become stable / unstable. Views by feature branches vs. base branches.
- Provides visibility into whether test stability is degrading or improving for base branches.
- Whether test run times are increasing or decreasing (understand P50, P90 , etc of test run times).
- Ability to rerun the test suite at a particular cadence (nightly jobs) to proactively identify flakes.
- Provides visibility into whether the test suite is failing because of infra issues (something where we don’t even get a test report) or a real test failure.
- Automatically rerun the test suite if the test failed because of infra issues.
- Ability to rerun flaky tests so users can get clean test results.

Read more in our docs: https://docs.aviator.co/

## Usage
To use CircleCI orb, you need to just specify Aviator API token along with the path to the assets.
To use the CircleCI orb, you need specify the path to the assets.
In addition, you need to set AVIATOR_API_TOKEN as an [environment variable in CircleCI](https://circleci.com/docs/set-environment-variable/#set-an-environment-variable-in-a-project).

Example:

Expand All @@ -46,16 +42,12 @@ usage:
- run:
name: Run tests and upload results
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
pip install pytest-aviator
python -m pytest -vv --junitxml="test_results/output.xml"
- store_artifacts:
path: ./test_results/output.xml
destination: output.xml
- aviator-upload-orb/upload:
aviator_api_token: "av_token_123"
assets: "test_results/*.xml"
workflows:
test-and-upload:
Expand Down
4 changes: 0 additions & 4 deletions src/commands/upload.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
description: >
This command uploads one or more JUnit XML files represented as assets.
parameters:
aviator_api_token:
type: string
description: "Aviator API Token associated with your account."
assets:
type: string
description: "Path to the file or files to upload."
steps:
- run:
environment:
AVIATOR_API_TOKEN: <<parameters.aviator_api_token>>
ASSETS: <<parameters.assets>>
name: Upload junit xml files
when: always
Expand Down
1 change: 0 additions & 1 deletion src/examples/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ usage:
path: ./test_results/output.xml
destination: output.xml
- aviator-upload-orb/upload:
aviator_api_token: "av_token_123"
assets: "test_results/output.xml"
workflows:
test-and-upload:
Expand Down

0 comments on commit 08badbe

Please sign in to comment.