Package: appsurify-testbrain-cli
Appsurify Script InstallationIndexInstallation InstructionsRequirementsSupport OS / PythonInstallation CommandRepository Push / Git2Testbrain (git2appsurify)Possible paramsUsage ExamplesRepository CheckoutPossible paramsUsage ExamplesQA2Testbrain (runtestswithappsurify)RefsDocumentation Testbrain CLIPyPiGitHubDockerREADMEInstallation InstructionsRequirementsPython 3.7+Note: Support for Python 3.7 will be completed soon because
this version is already considered deprecatedSupport OS / PythonOSPythonSupportLinux3.7🟢Linux3.8🟢Linux3.11🟢MacOS3.7🟢MacOS3.8🟢MacOS3.11🟢Windows3.7🟢Windows3.8🟢Windows3.11🟢Installation Commandpipinstallappsurify-testbrain-cliorpoetryaddappsurify-testbrain-cliNote: Use-Uor--upgradefor force upgrade to last versionDocker image "appsurify-testbrain-cli"Latest versiondockerpullappsurifyinc/appsurify-testbrain-cliSpecify versiondockerpullappsurifyinc/appsurify-testbrain-cli:2023.10.24Howto usageRepository Push | Git2Testbrain (git2appsurify)This module is used to push changes in the repository to the Testbrain
server for further analysis and testing optimization.This module can be used as an independent command in the OS or as
a subcommand of the main CLI application "testbrain"Alias #1testbraingitpush--helpAlias #2git2testbrainpush--helpAlias #3testbraingit2testbrainpush--helpPossible paramsRequiredParameterDefaultEnvDescriptionExampleyes--serverTESTBRAIN_SERVEREnter your testbrain server instance url.http://127.0.0.1yes--tokenTESTBRAIN_TOKENEnter your testbrain server instance token.yes--projectTESTBRAIN_PROJECTEnter your testbrain project name.no--work-dircurrent dirTESTBRAIN_WORK_DIREnter the testbrain script working directory. If not specified, the current working directory will be used.no--repo-nameTESTBRAIN_REPO_NAMEDefine repository name. If not specified, it will be automatically taken from the GitRepository repository.no--repo-dircurrent dirTESTBRAIN_REPO_DIREnter the git repository directory. If not specified, the current working directory will be used.no--branchcurrentTESTBRAIN_BRANCHEnter the explicit branch to process commits. If not specified, use current active branch.no--start / --commitlatest (HEAD)TESTBRAIN_START_COMMITEnter the commit that should be starter. If not specified, it will be used 'latest' commit.no--number1TESTBRAIN_NUMBER_OF_COMMITSEnter the number of commits to process.no (unavailable)--blamefalseAdd blame information.no--minimizefalseSuppress commit changes information. [default: (False)]no--pr-modefalseTESTBRAIN_PR_MODEActivate PR modeno-l, --loglevelINFOPossible failities: DEBUG/INFO/WARNING/ERRORno--logfilestderrSave logs to fileno--quietfalseQuiet mode... everytime exit with 0Usage examplesPush to Testbrain server only one last commit from current branchgit2testbrain--serverhttps://demo.appsurify.com--token**************************************************************--projectDEMOorgit2testbrainpush--serverhttps://demo.appsurify.com--token**************************************************************--projectDEMOPush to Testbrain server last 100 commits
started from specify commit into specify branchgit2testbrain--serverhttps://demo.appsurify.com--token**************************************************************--projectDEMO--branchmain--startlatest--number100If need more process information - change logging levelgit2testbrain--serverhttps://demo.appsurify.com--token**************************************************************--projectDEMO--branchmain--startlatest--number100--loglevelDEBUGAdd log file with full or relative path.git2testbrain--serverhttps://demo.appsurify.com--token**************************************************************--projectDEMO--branchmain--startlatest--number100--loglevelINFO--logfile./git2testbrain.logIf any crash errors script will create crash dump file into {WORK_DIR}/.crashdumps/git2testbrain--serverhttps://demo.appsurify.com--token**************************************************************--projectDEMOYou can see this message2023-11-05 21:16:03 INFO     testbrain.repository.cli push [repository/cli.py:184] Running...
2023-11-05 21:16:03 DEBUG    testbrain.terminal.process Process.__init__ [terminal/process.py:22] Set up execution working dir ...
Dumped crash report to <path_to_work_dir>/.crashdumps/git2testbrain-2023-10-23-11-27-39.dumpDocker version usage$(pwd) - git repository pathdockerrun--rm-it\-v$(pwd)/:/data\appsurifyinc/appsurify-testbrain-cligit2testbrain--serverhttps://demo.appsurify.com--token**************************************************************--projectDEMOCI example (github actions).github/workflows/testbrain-git2testbrain.ymlname:"Testbrain"on:workflow_dispatch:pull_request:branches:-"main"-"development"push:branches:-"main"-"releases/*.*.*"-"development"jobs:push-changes:name:"Pushchangestoserver"runs-on:ubuntu-latestpermissions:contents:writepull-requests:writechecks:writesteps:-name:"Checkoutgit"uses:actions/checkout@v4with:fetch-depth:0-name:"Extractbranchname"shell:bashrun:echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUTid:extract_branch-name:"Push"uses:addnab/docker-run-action@v3with:image:appsurifyinc/appsurify-testbrain-cli:latestoptions:-v ${{ github.workspace }}:/data -e TESTBRAIN_PR_MODE=${{ github.event_name == 'pull_request' }}run:|git2testbrain push --server ${{ vars.TESTBRAIN_SERVER }} --token ${{ secrets.TESTBRAIN_TOKEN }} --project ${{ vars.TESTBRAIN_PROJECT }} --branch ${{ steps.extract_branch.outputs.branch }} --start ${{ github.sha }} --number ${{ vars.TESTBRAIN_NUMBER_OF_COMMITS }} -l DEBUG-name:"Uploadcrashdumps"uses:actions/upload-artifact@v3if:failure()with:name:"crashdumps"path:${{ github.workspace }}/.crashdumps/retention-days:1Repository CheckoutThis module is used to checkout branches during
the execution of CI pipelines or manually.Cloning is not provided.Alias #1testbraingitcheckout--helpAlias #2git2testbraincheckout--helpAlias #3testbraingit2testbraincheckout--helpPossible paramsRequiredParameterDefaultEnvDescriptionExampleno--repo-dircurrent dirTESTBRAIN_REPO_DIREnter the git repository directory. If not specified, the current working directory will be used.no--branchcurrentTESTBRAIN_BRANCHEnter the explicit branch to process commits. If not specified, use current active branch.no--commitlatest (HEAD)TESTBRAIN_START_COMMITEnter the commit that should be starter. If not specified, it will be used 'latest' commit.no--pr-modefalseTESTBRAIN_PR_MODEActivate PR modeno--work-dircurrent dirTESTBRAIN_WORK_DIREnter the testbrain script working directory. If not specified, the current working directory will be used.no-l, --loglevelINFOPossible failities: DEBUG/INFO/WARNING/ERRORno--logfilestderrSave logs to fileno--quietfalseQuiet mode... everytime exit with 0Usage examplesCheckout using Testbrain CLIgit2testbraincheckout--branchmain-lINFOorgit2testbraincheckout--branchmain--commit75ec2f061868c33306963a27d5164211553c049b--pr-mode-lINFOorgit2testbraincheckout--branchmain--commit676c581--pr-mode-lINFODocker version usage$(pwd) - git repository pathdockerrun--rm-it\-v$(pwd)/:/data\appsurifyinc/appsurify-testbrain-cligit2testbraincheckout--branchmain--commit676c581--pr-mode-lINFOQA2Testbrain (runtestswithappsurify)Coming soon. Currently under development. Use the old 'appsurifyci' packagepipinstallappsurifyci--upgrade