Skip to main content

Teko CLI Tools

This is a Python package that contains some classed and CLI tools to be used during development process at Teko Vietnam (https://teko.vn).

List of tools:

  • Teko Jira Tools
  • Teko pytest test report fixture (coming soon)
  • Teko CodeSignal Tournament Result Fetching (coming soon)
  • More to come...

Installation

To use this tools, Python 3.6+ should be instaled.

Instal and/or upgrade to the latest version:

$ pip install --upgrade teko-cli

After successul installation, you should be able to use teko command in your console terminal:

$ teko

You should see this kind of help message:

Usage: teko [OPTIONS] COMMAND [ARGS]...

Options:
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.

  --help                          Show this message and exit.

Commands:
  cs
  jira

Using Teko Jira tool

Configure Jira credential

This tool use user/pass authentication to Jira server, and working with one Jira project at the same time. Jira server authentication uses 4 environment variables below. You can set these variables to the your environment, or save it to .env file in working directory:

Sample content of .env file:

export JIRA_SERVER=jira.teko.vn
export JIRA_USERNAME=thuc.nc
export JIRA_PASSWORD=sample_password
export JIRA_PROJECT_KEY=TESTING

Submit (create) list of testcases to a Jira Project

To push testcases to a Jira Project, you should prepare a .yaml or a .json file, containing list of testcases to be created in Jira, then use following command:

$ teko jira create-tests {testcase_file}

To see help message, use --help option: teko jira create-tests --help:

Usage: teko jira create-tests [OPTIONS] FILE



Arguments:
  FILE  The name of a testcase definition file  [required]

Options:
  --help  Show this message and exit.

Note that this tool use test case name as key, so existing tests with same name will be updated with latest information.

Sample testcases file

  • .yaml file
- name: Testcase 01
  issueLinks: [TESTING-4]
  objective: Test 01 Objective
  precondition: Test 01 Precondition
  testScript:
    type: PLAIN_TEXT
    text: >
      - init x and y <br/>
      - call func add(x, y)
- name: Testcase 02
  issueLinks: [TESTING-4, TESTING-5]
  objective: Test 02 Objective
  precondition: Test 02 Precondition
  priority: Normal
  status: Draft
  testScript:
    type: STEP_BY_STEP
    steps:
    - description: Step 1
      testData: <code>(x,y) = (1,3)</code>
      expectedResult: <strong>4</strong>
    - description: Step 2
      testData: <code>(x,y) = (4,5)</code>
      expectedResult: <strong>9</strong>
  • Equivalent .json file:
[
  {
    "name": "Testcase 01",
    "issueLinks": [
      "TESTING-4"
    ],
    "objective": "Test 01 Objective",
    "precondition": "Test 01 Precondition",
    "testScript": {
      "type": "PLAIN_TEXT",
      "text": "- init x and y <br/> - call func add(x, y)\n"
    }
  },
  {
    "name": "Testcase 02",
    "issueLinks": [
      "TESTING-4",
      "TESTING-5"
    ],
    "objective": "Test 02 Objective",
    "precondition": "Test 02 Precondition",
    "priority": "Normal",
    "status": "Draft",
    "testScript": {
      "type": "STEP_BY_STEP",
      "steps": [
        {
          "description": "Step 1",
          "testData": "<code>(x,y) = (1,3)</code>",
          "expectedResult": "<strong>4</strong>"
        },
        {
          "description": "Step 2",
          "testData": "<code>(x,y) = (4,5)</code>",
          "expectedResult": "<strong>9</strong>"
        }
      ]
    }
  }
]

Create test cycle (testrun result) in a Jira Project

To create a testrun report (cycle) to a Jira Project, you should prepare a .yaml or a .json file, containing list of testcases and their result to be created in Jira, then use following command:

$ teko jira create-cycle {testcase_file}

The testcase file stuctures are the same as above, with following additional fields for test result:

testrun_status: Pass
testrun_environment: Dev
testrun_comment: The test has failed on some automation tool procedure
testrun_duration: 300000 #ms
testrun_date: "2020-12-12T14:54:00Z" # put datetime inside double quotes to avoid parsing

Sample testrun (cycle) file

  • .yaml file
- name: Testcase 01
  testrun_status: Pass
  testrun_environment: Dev
  testrun_comment: The test has failed on some automation tool procedure
  testrun_duration: 300000 #ms
  testrun_date: "2020-12-12T14:54:00Z" 
- name: Testcase 02
  testrun_status: Fail
  testrun_environment: Test1
  testrun_comment: The test has failed on some automation tool procedure
  testrun_duration: 30000 #ms
  testrun_date: "2020-12-12T14:54:00Z"
  • Equivalent .json file
[
  {
    "name": "Testcase 01",
    "testrun_status": "Pass",
    "testrun_environment": "Dev",
    "testrun_comment": "The test has failed on some automation tool procedure",
    "testrun_duration": 300000,
    "testrun_date": "2020-12-12T14:54:00Z"
  },
  {
    "name": "Testcase 02",
    "testrun_status": "Fail",
    "testrun_environment": "Test1",
    "testrun_comment": "The test has failed on some automation tool procedure",
    "testrun_duration": 30000,
    "testrun_date": "2020-12-12T14:54:00Z"
  }
]

Please note that the files use same structure as in case of creating testcases above, with additional fields, and also uses testcase name as key in Jira. So you can you a single combined file for both operation: create tests and create cycles. This file can be generated automatically from docstrings and/or annotation / decorator in auto test code.

Sample combined testcase file with test results

  • .yaml file
- name: Testcase 01
  issueLinks: [TESTING-4]
  objective: Test 01 Objective
  precondition: Test 01 Precondition
  testScript:
    type: PLAIN_TEXT
    text: >
      - init x and y <br/>
      - call func add(x, y)
  testrun_status: Pass
  testrun_environment: Dev
  testrun_comment: The test has failed on some automation tool procedure
  testrun_duration: 300000 #ms
  testrun_date: "2020-12-12T14:54:00Z" 
- name: Testcase 02
  issueLinks: [TESTING-4, TESTING-5]
  objective: Test 02 Objective
  precondition: Test 02 Precondition
  priority: Normal
  status: Draft
  testScript:
    type: STEP_BY_STEP
    steps:
    - description: Step 1
      testData: <code>(x,y) = (1,3)</code>
      expectedResult: <strong>4</strong>
    - description: Step 2
      testData: <code>(x,y) = (4,5)</code>
      expectedResult: <strong>9</strong>
  testrun_status: Fail
  testrun_environment: Test1
  testrun_comment: The test has failed on some automation tool procedure
  testrun_duration: 30000 #ms
  testrun_date: "2020-12-12T14:54:00Z"
  • Equivalent .json file
[
  {
    "name": "Testcase 01",
    "issueLinks": [
      "TESTING-4"
    ],
    "objective": "Test 01 Objective",
    "precondition": "Test 01 Precondition",
    "testScript": {
      "type": "PLAIN_TEXT",
      "text": "- init x and y <br/> - call func add(x, y)\n"
    },
    "testrun_status": "Pass",
    "testrun_environment": "Dev",
    "testrun_comment": "The test has failed on some automation tool procedure",
    "testrun_duration": 300000,
    "testrun_date": "2020-12-12T14:54:00Z"
  },
  {
    "name": "Testcase 02",
    "issueLinks": [
      "TESTING-4",
      "TESTING-5"
    ],
    "objective": "Test 02 Objective",
    "precondition": "Test 02 Precondition",
    "priority": "Normal",
    "status": "Draft",
    "testScript": {
      "type": "STEP_BY_STEP",
      "steps": [
        {
          "description": "Step 1",
          "testData": "<code>(x,y) = (1,3)</code>",
          "expectedResult": "<strong>4</strong>"
        },
        {
          "description": "Step 2",
          "testData": "<code>(x,y) = (4,5)</code>",
          "expectedResult": "<strong>9</strong>"
        }
      ]
    },
    "testrun_status": "Fail",
    "testrun_environment": "Test1",
    "testrun_comment": "The test has failed on some automation tool procedure",
    "testrun_duration": 30000,
    "testrun_date": "2020-12-12T14:54:00Z"
  }
]

Change log

[0.9.5] - 2021-01-08

Add

  • Add confluence link and some refactoring

[0.1.0] - 2020-12-08

Add

  • Initiate

[0.1.1] - 2020-12-11

Add

  • First MVP

Metadata

Release files for teko-cli 0.9.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for teko-cli 0.9.5
File Size Uploaded Provenance
teko-cli-0.9.5.tar.gz 13.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for teko-cli 0.9.5
File Interpreter ABI Platform
teko_cli-0.9.5-py3-none-any.whl Python 3 none any Details

Total release size: 28.3 kB

Release files / teko-cli-0.9.5.tar.gz

Download URL teko-cli-0.9.5.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
98ed1cc1a54cf9f6b7e67dd816c60c8ee44ac819933dc7b838d219e6210ed82c
BLAKE2b-256 checksum
How to use checksums
3225d106f54953e38fe909446e49eb90f7173fd8aa5c4ef672ff6268c95ad8f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Release files / teko_cli-0.9.5-py3-none-any.whl

Download URL teko_cli-0.9.5-py3-none-any.whl
Size 14.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32d4dde78c84773df74319daf79e7127a8c49a27769ea276e5ea0efa07563e20
BLAKE2b-256 checksum
How to use checksums
c91ad878a5a1e28da96b56a87af2de64f5f4b06fdce174d1dbe62f39925c3164
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

Security for teko-cli 0.9.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page