Metadata-Version: 2.1
Name: ntscli-client
Version: 0.1.5
Summary: UNKNOWN
Home-page: https://stash.corp.netflix.com/projects/NTSSER/repos/ntscli-client/browse
Author: TSC
Author-email: davidb@netflix.com
License: UNKNOWN
Platform: UNKNOWN
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: click
Requires-Dist: click-completion
Requires-Dist: click-log
Requires-Dist: colorama
Requires-Dist: ntscli-cloud-lib
Requires-Dist: requests
Requires-Dist: dataclasses ; python_version < "3.7"
Provides-Extra: dev
Requires-Dist: behave ; extra == 'dev'
Requires-Dist: flake8 ; extra == 'dev'
Requires-Dist: mypy ; extra == 'dev'
Requires-Dist: pyinstaller ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: semver ; extra == 'dev'
Requires-Dist: tox ; extra == 'dev'

# ntscli-client

# Requirements

* python 3.6 or later with matching pip
* Netflix VPN access (at installation time only)
* nts-cli compatible SSL configuration as documented at go/ntscli

# Install

## Installing on the OS python:

`sudo pip3 install -U ntscli-client -i https://smartiproxy.mgmt.netflix.net/pypi`

## In case `nts` is not found

Most of us can skip this. If you're installing in a special per-user or isolated python3 environment 
(and trust me, you'll know if you are), you get to skip the sudo, but you might have to add a path to your system PATH variable, 
[depending on if your OS-managed python is set up right:](https://github.com/pypa/pip/issues/3813). 

```shell script
echo "export PATH=\"$(python3 -m site --user-base)/bin:$PATH\"" >> ~/.bashrc
source ~/.bashrc
```

# Update Often

Use the same command, but especially for the first little while there will probably be daily updates.

# Enjoy

`nts --help`

```shell script
export RAE=r3000334
export ESN=$(nts get-devices | jq -r 'map(.esn)[0]')  # actually just the first ESN I find
# or for powershell:
$env:RAE = 'r3000334'
$env:ESN = 'NFANDROID2-PRV-SHIELDANDROIDTV-NVIDISHIELD=ANDROID=TV-15895-BB9C5AF4E97B69BC1A51654A94304D3AD88169C2BA2F1338192C20E940AE669E'

nts get-plan  # prints to stdout

# get a plan dynamically
nts run
# get a plan and run it immediately
nts get-plan | nts run
# save the plan via shell redirection
nts get-plan > full_plan.json

# save the plan with an arg instead
nts get-plan --save-to full_plan.json

# Choosing what to run

## Just at run:
nts run AUDIO-001-TC1 ACT-004-TC11  # gets the test plan first, then filters
nts run --testplan full_plan.json AUDIO-001-TC1 ACT-004-TC11  # saves you the 1-2 minutes getting the test plan if you already have one

## using files
nts get-plan --save-to full_plan.json
cat full_plan.json | jq -r '{target: .target, testplan: {branch: .testplan.branch, sdkVersion: .testplan.sdkVersion, testcases: [.testplan.testcases[] | select(.category | startswith("Config"))] }}' > filtered_plan.json
cat filtered_plan.json | nts run 

## built-in filtering command
nts get-plan --save-to full_plan.json
nts filter --help
nts filter AUDIO-001-TC1 < full_plan.json > filtered_plan.json
nts filter AUDIO-001-TC1 --testplan full_plan.json --save-to filtered_plan.json
nts filter --names-re "AUDIO.*TC3" full_plan.json --save-to filtered_plan.json
nts get-plan | nts filter --eyepatch --tags batch | nts run

## DIY Filtering using external tools, if you -really- want to
CURRENT_EPOCH=$(date +%s) 
nts get-plan | jq -r '{target: .target, testplan: {branch: .testplan.branch, sdkVersion: .testplan.sdkVersion, testcases: [.testplan.testcases[] | select(.category | startswith("Config"))] }}' | nts run 2>${CURRENT_EPOCH}.stderr.txt > ${CURRENT_EPOCH}.json 
```

#### Features

* Typical shell stdin/stdout piping
* Typical shell exit codes
* Multi-OS, multi-shell compatible
* Tab completion available (see `nts completion`)
* (after release) No Netflix VPN dependencies

---

This project was seeded via `newt init --app-type python`, see [go/python](http://go/python) for more info.

