def new_test(py_ver: PyVer, cloud_host: CloudHost):
    """Job for running integration/coverage tests"""
    sdk_docker_cache = f'app_{py_ver.name}.tar'
    template = yaml.safe_load(f"""
    machine:
      image: circleci/classic:201710-02
    steps:
      - checkout
      - attach_workspace:
          at: {cache_dir}
      - run:
          name: Load docker image for SDK
          command: docker load -i {cache_dir}/{sdk_docker_cache}
      - run:
          name: Load docker image for TestRunner
          command: docker load -i {cache_dir}/{testrunner_cache}
      - run:
          name: Get docker-compose
          command: pip install docker-compose==1.21.0
      - run:
          name: Set testrunner parameters
          command: |-
            echo 'export TEST_RUNNER_DEFAULT_API_HOST=${{{cloud_host.envvar_host}}}' >> $BASH_ENV
            echo 'export TEST_RUNNER_DEFAULT_API_KEY=${{{cloud_host.envvar_key}}}' >> $BASH_ENV
      - run:
          name: Run all tests
          no_output_timeout: 15m
          command: >-
            docker-compose
            -f {os.path.relpath(container_config_root, PROJECT_ROOT)}/{py_ver.compose_file}
            up
            --exit-code-from=sdk_test_server
      - run:
          name: Generate summary
          command: sudo python scripts/ci_summary.py --noblock
          when: always
      - store_artifacts:
          path: results
      - run:
          name: Install codecov
          command: sudo pip install codecov
      - run: 
          command: codecov --file=results/coverage.xml --flags {py_ver.name} {cloud_host.public_name}
          name: Upload code coverage results
    """)
    return test_name(py_ver, cloud_host), template
def new_test ( py_ver : PyVer , cloud_host : CloudHost ) : sdk_docker_cache = f'app_{py_ver.name}.tar' template = yaml . safe_load ( f"""
    machine:
      image: circleci/classic:201710-02
    steps:
      - checkout
      - attach_workspace:
          at: {cache_dir}
      - run:
          name: Load docker image for SDK
          command: docker load -i {cache_dir}/{sdk_docker_cache}
      - run:
          name: Load docker image for TestRunner
          command: docker load -i {cache_dir}/{testrunner_cache}
      - run:
          name: Get docker-compose
          command: pip install docker-compose==1.21.0
      - run:
          name: Set testrunner parameters
          command: |-
            echo 'export TEST_RUNNER_DEFAULT_API_HOST=${{{cloud_host.envvar_host}}}' >> $BASH_ENV
            echo 'export TEST_RUNNER_DEFAULT_API_KEY=${{{cloud_host.envvar_key}}}' >> $BASH_ENV
      - run:
          name: Run all tests
          no_output_timeout: 15m
          command: >-
            docker-compose
            -f {os.path.relpath(container_config_root, PROJECT_ROOT)}/{py_ver.compose_file}
            up
            --exit-code-from=sdk_test_server
      - run:
          name: Generate summary
          command: sudo python scripts/ci_summary.py --noblock
          when: always
      - store_artifacts:
          path: results
      - run:
          name: Install codecov
          command: sudo pip install codecov
      - run: 
          command: codecov --file=results/coverage.xml --flags {py_ver.name} {cloud_host.public_name}
          name: Upload code coverage results
    """ ) return test_name ( py_ver , cloud_host ) , template
Job for running integration/coverage tests