From eb6be4d68484415bdfa71435274260c4aa2dbfc4 Mon Sep 17 00:00:00 2001 From: Sourabh Date: Wed, 14 Sep 2022 17:37:47 +0530 Subject: [PATCH 1/3] CP-8874 Script to build the VSDK project with various commands --- .bumpversion.cfg | 13 +- .github/workflows/pre-commit.yml | 160 ++++------------ .github/workflows/publish-docs.yml | 52 +++-- README-dev.md | 12 +- bin/build_project.sh | 177 ++++++++++++++++++ .../dlpx/virtualization/_internal/conftest.py | 55 +++++- .../_internal/engine_version.cfg | 14 ++ .../_internal/test_package_util.py | 33 ++-- 8 files changed, 340 insertions(+), 176 deletions(-) create mode 100644 bin/build_project.sh create mode 100644 tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 310d8b1c..577a2b0d 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -3,16 +3,17 @@ current_version = 4.0.6.dev0 commit = False tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\.(?P[a-z]+)(?P\d+))? -serialize = +serialize = {major}.{minor}.{patch}.{release}{dev} {major}.{minor}.{patch} [bumpversion:part:release] -optional_value = prod +optional_value = _ first_value = dev -values = +values = dev - prod + rc + _ [bumpversion:part:dev] @@ -26,3 +27,7 @@ values = [bumpversion:file:./tools/src/main/python/dlpx/virtualization/_internal/VERSION] +[bumpversion:file:./tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py] +search = DVP_VERSION = '{current_version}' +replace = DVP_VERSION = '{new_version}' + diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 3aa35023..ab720ae8 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -1,158 +1,66 @@ -name: Pre-commit actions for Delphix Virtualization SDK +# +# Copyright (c) 2020, 2022 by Delphix. All rights reserved. +# -on: [pull_request] +name: "Pre-commit actions for Delphix Virtualization SDK" -jobs: - pytest27: - name: Test ${{ matrix.package }} on ${{ matrix.os }} using pytest (Python 2.7) - runs-on: ${{ matrix.os }} - strategy: - max-parallel: 4 - matrix: - python-version: [2.7] - os: [ubuntu-latest, macos-10.15, windows-latest] - package: [common, libs, platform] - - steps: - - name: Checkout ${{ matrix.package }} project - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - - name: Install ${{ matrix.package }} dependencies - working-directory: ${{ matrix.package }} - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt --find-links https://test.pypi.org/simple/dvp-api/ - - - name: Install ${{ matrix.package }} project - working-directory: ${{ matrix.package }} - run: | - pip install . --find-links https://test.pypi.org/simple/dvp-api/ - - - name: Test ${{ matrix.package }} project with pytest - working-directory: ${{ matrix.package }} - run: | - python -m pytest src/test/python +on: + # It is important to check the commits done to master, develop and release branches only. + pull_request: + branches: + - master + - develop + - release +jobs: pytest38: name: Test ${{ matrix.package }} on ${{ matrix.os }} using pytest (Python 3.8) runs-on: ${{ matrix.os }} strategy: max-parallel: 4 matrix: - python-version: [3.8] - os: [ubuntu-latest, macos-latest, windows-latest] - package: [common, libs, platform, tools] - - steps: - - name: Checkout ${{ matrix.package }} project - uses: actions/checkout@v1 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - - name: Install ${{ matrix.package }} dependencies - working-directory: ${{ matrix.package }} - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt --find-links https://test.pypi.org/simple/dvp-api/ - - - name: Install ${{ matrix.package }} project - working-directory: ${{ matrix.package }} - run: | - pip install . --find-links https://test.pypi.org/simple/dvp-api/ - - - name: Test ${{ matrix.package }} project with pytest - working-directory: ${{ matrix.package }} - run: | - python -m pytest src/test/python - - lintpython27: - name: Lint ${{ matrix.package }} - Python27 - - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - package: [common, libs, platform] + python-version: [ 3.8 ] + os: [ ubuntu-latest, macos-latest, windows-latest ] + package: [ common, libs, platform, tools ] steps: - - name: Checkout ${{ matrix.package }} - uses: actions/checkout@v1 + - name: Checkout ${{ matrix.package }} project + uses: actions/checkout@v3 - - name: Set up Python 2.7 - uses: actions/setup-python@v1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 with: - python-version: 2.7 + python-version: ${{ matrix.python-version }} - - name: Install flake8 + - name: Install ${{ matrix.package }} dependencies + working-directory: ${{ matrix.package }} run: | python -m pip install --upgrade pip - pip install flake8 + pip install -r requirements.txt --find-links https://test.pypi.org/simple/dvp-api/ - - name: Run flake8 on src directory + - name: Install ${{ matrix.package }} project working-directory: ${{ matrix.package }} - run: python -m flake8 src/main/python --max-line-length 88 + run: | + pip install . --find-links https://test.pypi.org/simple/dvp-api/ - - name: Run flake8 on test directory + # Run all the test cases part of the package. + - name: Test ${{ matrix.package }} project with pytest working-directory: ${{ matrix.package }} - run: python -m flake8 src/test/python --max-line-length 88 - - lintpython38: - name: Lint ${{ matrix.package }} - Python38 - - runs-on: ubuntu-latest - strategy: - max-parallel: 4 - matrix: - package: [common, libs, platform, tools] - - steps: - - name: Checkout ${{ matrix.package }} - uses: actions/checkout@v1 - - - name: Set up Python 3.8 - uses: actions/setup-python@v1 - with: - python-version: 3.8 + run: | + python -m pytest src/test/python + # Install flake8 and run linting on src and test for linting if OS is ubuntu. - name: Install flake8 + if: ${{ matrix.os == 'ubuntu-latest' }} run: | - python -m pip install --upgrade pip pip install flake8 - name: Run flake8 on src directory + if: ${{ matrix.os == 'ubuntu-latest' }} working-directory: ${{ matrix.package }} run: python -m flake8 src/main/python --max-line-length 88 - name: Run flake8 on test directory + if: ${{ matrix.os == 'ubuntu-latest' }} working-directory: ${{ matrix.package }} run: python -m flake8 src/test/python --max-line-length 88 - - #format: - #name: Check format ${{ matrix.package}} - - #runs-on: ubuntu-latest - #strategy: - #max-parallel: 4 - #matrix: - #package: [common, libs, platform, tools] - - #steps: - #- uses: actions/checkout@v1 - - #- name: Check src format - #uses: lgeiger/black-action@v1.0.1 - #with: - #args: "${{ matrix.package }}/src/main/python -t py27 --check" - - #- name: Check test format - #uses: lgeiger/black-action@v1.0.1 - #with: - #args: "${{ matrix.package }}/src/test/python -t py27 --check" diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml index 12938703..7caf21f4 100644 --- a/.github/workflows/publish-docs.yml +++ b/.github/workflows/publish-docs.yml @@ -1,3 +1,7 @@ +# +# Copyright (c) 2020, 2022 by Delphix. All rights reserved. +# + name: Publish docs to GitHub pages on: @@ -16,42 +20,52 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] - package: [docs] - repository: ['delphix/virtualization-sdk'] + python-version: [ 3.7 ] + package: [ docs ] + repository: [ 'delphix/virtualization-sdk' ] steps: + ### + # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. + # Set fetch-depth: 0 to fetch all history for all branches and tags. + ### - uses: actions/checkout@v2 with: - # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. - # Set fetch-depth: 0 to fetch all history for all branches and tags. fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + + ### + # Set CURRENT_BRANCH environment variable to the current branch name. Refrain from using 'set-env' as + # GitHub has identified the command as a moderate security vulnerability. + ### - name: Set the current branch environment variable working-directory: ${{ matrix.package }} run: | CURRENT_BRANCH_VAR=${GITHUB_REF#refs/heads/} echo "Current branch: $CURRENT_BRANCH_VAR" - # Set CURRENT_BRANCH environment variable to the current branch name. Refrain from using 'set-env' as - # GitHub has identified the command as a moderate security vulnerability. echo "CURRENT_BRANCH=$(echo $CURRENT_BRANCH_VAR)" >> $GITHUB_ENV + + # Display all remote branches - name: Display all remote branches working-directory: ${{ matrix.package }} - run: | - # Display all remote branches - git branch -r + run: git branch -r + + ### + # Get only docs branches, extract the "docs/x.y.z" part, sort them in descending order, and get the first one. + # Set the LATEST_DOCS_BRANCH environment variable. Refrain from using 'set-env' as GitHub has identified the + # command as a moderate security vulnerability. + ### - name: Set the latest docs branch environment variable working-directory: ${{ matrix.package }} run: | - # Get only docs branches, extract the "docs/x.y.z" part, sort them in descending order, and get the first one. LATEST_DOCS_BRANCH_VAR=$(git branch -r | grep -e ".*\/*docs\/[0-9].[0-9].[0-9]" | sed -n "s/.*\/*\(docs\/[0-9].[0-9].[0-9]\).*/\1/p" | sort -r | head -n 1) echo "Latest docs branch: $LATEST_DOCS_BRANCH_VAR" - # Set the LATEST_DOCS_BRANCH environment variable. Refrain from using 'set-env' as GitHub has identified the - # command as a moderate security vulnerability. echo "LATEST_DOCS_BRANCH=$(echo $LATEST_DOCS_BRANCH_VAR)" >> $GITHUB_ENV + - name: Check that the current branch is the latest docs branch, fail otherwise working-directory: ${{ matrix.package }} run: | @@ -61,16 +75,19 @@ jobs: else echo "The action is running on the latest docs branch." fi + - name: Install Pipenv uses: dschep/install-pipenv-action@v1 + - name: Install dependencies for building documenation working-directory: ${{ matrix.package }} - run: | - pipenv install + run: pipenv install + - name: Build documentation working-directory: ${{ matrix.package }} - run: | - pipenv run mkdocs build --clean + run: pipenv run mkdocs build --clean + + # Docs will be pushed to developer.delphix.com if the repository is delphix/virtualization-sdk. - name: Deploy the contents of docs/site to gh-pages (developer.delphix.com) 🚀 if: ${{ github.repository == matrix.repository }} uses: peaceiris/actions-gh-pages@v3 @@ -81,6 +98,7 @@ jobs: user_name: "github-actions[bot]" user_email: "github-actions[bot]@users.noreply.github.com" cname: developer.delphix.com + - name: Deploy the contents of docs/site to personal gh-pages 🚀 if: ${{ github.repository != matrix.repository }} uses: peaceiris/actions-gh-pages@v3 diff --git a/README-dev.md b/README-dev.md index 65f3ce74..6a82a865 100644 --- a/README-dev.md +++ b/README-dev.md @@ -1,4 +1,4 @@ -# Copyright (c) 2019 by Delphix. All rights reserved. +# Copyright (c) 2019, 2022 by Delphix. All rights reserved. # Delphix Virtualization SDK @@ -63,9 +63,8 @@ To install the SDK, follow these steps: One of the SDK dependencies - dvp-api - is currently hosted on [TestPyPi](https://test.pypi.org/project/dvp-api/). By default `pip` looks at pypi.org for packages to install. In order to successfully install the SDK, you have to configure pip to search an additional package repository - test.pypi.org. -2. Go into one of the package directories (common, dvp, libs, platform, tools) and run the commands below. -3. Install the package's development dependencies: `pip install -r requirements.txt`. -4. Install the package itself (use `-e` flag if you want to install the package in editable mode): `pip install .`. +2. To build the project, run `sh bin/build_project.sh -b`. +3. For more information on the script options, use `sh bin/build_project.sh -h`. ### CLI changes @@ -111,9 +110,8 @@ Go into one of the package directories (common, dvp, libs, platform, tools) and 1. Install the package's development dependencies and package itself by following the directions in [the SDK installation section](#installing-the-sdk-from-source). 2. Run unit tests: `python -m pytest src/test/python`. - -There's no way to locally run unit tests in all packages with one command. However, they will be run automatically -through GitHub Actions when you open a pull request. You can always open a draft pull request +3. To run unit tests in all packages with one command, run `sh bin/build_project.sh -t`. +4. For more information on the script options, use `sh bin/build_project.sh -h`. ### Manual testing diff --git a/bin/build_project.sh b/bin/build_project.sh new file mode 100644 index 00000000..5f237d95 --- /dev/null +++ b/bin/build_project.sh @@ -0,0 +1,177 @@ +#!/bin/bash +# +# Copyright (c) 2022 by Delphix. All rights reserved. +# + +# This script provides functionality to build and run test cases for all python packages. The same script can be used +# to build and run test cases for specific python packages also. + +############################################################ +# Global Variables # +############################################################ +modules=("common" "libs" "platform" "tools" "dvp") +should_build=false +should_test=false +verbose=false +screenSize=$(tput cols) +equalFiller="=" +greenColor=$(tput setaf 10) +orangeColor=$(tput setaf 208) +noColor=$(tput sgr0) +blackColor=$(tput setaf 0) +blueColor=$(tput setaf 31) + +############################################################ +# Help # +############################################################ +Help() { + # Display Help + tput setaf 11 + echo "Build and Run test cases for python modules common, libs, platform, tools and dvp." + tput setaf 1 + echo "Syntax: sh build_project.sh -[h|b|t|v|m]" + print_separator + tput bold + echo " ${blueColor}Options${blackColor} | ${blueColor}Description${blackColor} | ${blueColor}Examples${noColor}" + print_separator + echo " h${blackColor} | ${orangeColor}Print this Help. ${blackColor} | ${greenColor}sh build_project.sh -h${noColor}" + print_separator + echo " b${blackColor} | ${orangeColor}Build the modules. ${blackColor} | ${greenColor}sh build_project.sh -b${noColor}" + echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -b -m common${noColor}" + print_separator + echo " t${blackColor} | ${orangeColor}Run tests for the modules.${blackColor} | ${greenColor}sh build_project.sh -t${noColor}" + echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bt -m tools${noColor}" + print_separator + echo " v${blackColor} | ${orangeColor}Verbose mode on ${blackColor} | ${greenColor}sh build_project.sh -t -v${noColor}" + echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bvt -m tools${noColor}" + print_separator + echo " m${blackColor} | ${orangeColor}provide a list of modules.${blackColor} | ${greenColor}sh build_project.sh -bt -m common -m libs${noColor}" + echo " ${blackColor} | ${orangeColor}Valid python modules: ${blackColor} | ${noColor}" + echo " ${blackColor} | ${orangeColor} - common ${blackColor} | ${noColor}" + echo " ${blackColor} | ${orangeColor} - libs ${blackColor} | ${noColor}" + echo " ${blackColor} | ${orangeColor} - platform ${blackColor} | ${noColor}" + echo " ${blackColor} | ${orangeColor} - tools ${blackColor} | ${noColor}" + echo " ${blackColor} | ${orangeColor} - dvp ${blackColor} | ${noColor}" + print_separator +} + +print_separator() { + echo \ + "${blackColor}----------------------------------------------------------------------------------------------------${noColor}" +} + +############################################################ +############################################################ +# Main program # +############################################################ +############################################################ +############################################################ +# Process the input options. Add options as needed. # +############################################################ + +# Run operation for module +run_operations() { + module_name=$1 + current_path="$PWD" + module_path="$(get_project_path)/$module_name" + cd "$module_path" || exit + if [ "$should_build" = true ]; then + echo + print_as_per_screen_size " $module_name build starts " "${orangeColor}" ${equalFiller} "${screenSize}" + build_module + print_as_per_screen_size " $module_name build complete " "${greenColor}" ${equalFiller} "${screenSize}" + fi + if [ "$should_test" = true ]; then + echo + print_as_per_screen_size " $module_name tests starts " "${orangeColor}" ${equalFiller} "${screenSize}" + test_module + print_as_per_screen_size " $module_name tests complete " "${greenColor}" ${equalFiller} "${screenSize}" + fi + cd "$current_path" || exit +} + +# get the project full path like Users/test-user/repository/virtualization-sdk +get_project_path() { + SCRIPT_RELATIVE_DIR=$(dirname "${BASH_SOURCE[0]}") + cd "$SCRIPT_RELATIVE_DIR" || exit + script_path="$PWD" + dirname "$script_path" +} + +# Build the module +build_module() { + python setup.py clean --all + if [ "$verbose" = true ]; then + pip install -r requirements.txt -v + pip install -e . -v + else + pip install -r requirements.txt -q + pip install -e . -q + fi +} + +# Test the module +test_module() { + if [ "$verbose" = true ]; then + python -m pytest -v src/test/python + else + python -m pytest src/test/python + fi +} + +# Print the provided input in the center of screen by appending and prepending fillers. +print_as_per_screen_size() { + columns=$4 + width="${#1}" + adjust=$(((columns - width) / 2)) + printf "${3}%.0s" $(seq $adjust) + printf "${2}%s${noColor}" "${1}" + adjust=$((columns - (adjust + width))) + printf "${3}%.0s" $(seq $adjust) + printf "\n" +} + +# Get the options +while getopts ":hbtvm:" option; do + case $option in + h) # display Help + Help + exit + ;; + b) # Build modules + should_build=true ;; + t) # Test modules + should_test=true ;; + m) # Check Modules + if [[ ${modules[*]} =~ (^|[[:space:]])"$OPTARG"($|[[:space:]]) ]]; then + multi+=("$OPTARG") + else + echo "Modules must be one of [${modules[*]}]." && exit 1 + fi ;; + v) # Verbose mode + verbose=true ;; + \?) # Invalid options. + echo "Error: Invalid option" + Help + exit 1 + ;; + :) # Missing arguments + echo "Missing option argument for -$OPTARG" >&2 + exit 1 + ;; + *) # Unimplemented option if any + echo "Unimplemented option: -$option" >&2 + exit 1 + ;; + esac +done + +if [ "$should_build" = true ] || [ "$should_test" = true ]; then + if [ ${#multi[@]} -eq 0 ]; then + multi=("${modules[@]}") + fi + + for module in "${multi[@]}"; do + run_operations "$module" + done +fi diff --git a/tools/src/test/python/dlpx/virtualization/_internal/conftest.py b/tools/src/test/python/dlpx/virtualization/_internal/conftest.py index 3b05daae..13fb0254 100644 --- a/tools/src/test/python/dlpx/virtualization/_internal/conftest.py +++ b/tools/src/test/python/dlpx/virtualization/_internal/conftest.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 by Delphix. All rights reserved. +# Copyright (c) 2019, 2022 by Delphix. All rights reserved. # import configparser @@ -7,14 +7,16 @@ import json import os import shutil - from importlib import reload + +import pytest import yaml +from dlpx.virtualization.common.util import to_bytes, to_str + +from dlpx.virtualization import _internal as virtualization_internal from dlpx.virtualization._internal import cli, click_util, const, package_util from dlpx.virtualization._internal.commands import build -from dlpx.virtualization.common.util import to_bytes, to_str -import pytest # # conftest.py is used to share fixtures among multiple tests files. pytest will @@ -709,8 +711,25 @@ def artifact_content(engine_api, virtual_source_definition, @pytest.fixture -def engine_api(): - return {'type': 'APIVersion', 'major': 1, 'minor': 12, 'micro': 0} +def engine_api_version_string(): + """ + Returns the engine api version from engine_version.cfg file. + """ + return _get_engine_version().get('General', 'engine_api_version') + + +@pytest.fixture +def engine_api(engine_api_version_string): + """Returns the engine api version in JSON format.""" + major, minor, micro = ( + int(n) for n in engine_api_version_string.split('.')) + engine_api_version = { + 'type': 'APIVersion', + 'major': major, + 'minor': minor, + 'micro': micro + } + return engine_api_version @pytest.fixture @@ -796,3 +815,27 @@ def __init__(self, name, source_dir, plugin_content_dir, schema_dict): self.schema_dict = schema_dict return CodegenInput(plugin_name, src_dir, tmpdir.strpath, schema_content) + + +def _get_engine_version(): + """ + Reads the engine_version.cfg file and constructs a Python object from it. + + This assumes that the engine_version.cfg file is in the root + of dlpx.virtualization._internal. + """ + parser = configparser.ConfigParser() + parser.read(get_engine_version_file_path()) + return parser + + +def get_engine_version_file_path(): + """ + Returns the engine_version.cfg file path. + """ + for path in virtualization_internal.__path__: + engine_path = os.path.join(path, 'engine_version.cfg') + if os.path.isfile(engine_path): + return engine_path + else: + raise RuntimeError('Could not find engine version file') diff --git a/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg b/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg new file mode 100644 index 00000000..d57b4e49 --- /dev/null +++ b/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg @@ -0,0 +1,14 @@ +# +# Copyright (c) 2022 by Delphix. All rights reserved. +# + +# +# engine_api_version is the Delphix API version which is used to make API calls to Delphix engine. The Version will +# be different for develop branch and master branch. +# +# Develop branch engine_api_version is always ahead of the Master branch engine_api_version. +# Please do not add any other details in the file which can create merge issues between master and develop branch. +# This file also should not be updated manually with feature changes. +# +[General] +engine_api_version = 1.12.0 diff --git a/tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py b/tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py index c17a3a5b..58c4d3f7 100644 --- a/tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py +++ b/tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py @@ -2,43 +2,44 @@ # Copyright (c) 2019, 2022 by Delphix. All rights reserved. # import os -from dlpx.virtualization._internal import package_util import pytest +from dlpx.virtualization._internal import package_util + +DVP_VERSION = '4.0.6.dev0' +DVP_API_VERSION = '1.7.0' + class TestPackageUtil: @staticmethod def test_get_version(): - assert package_util.get_version() == '4.0.6.dev0' + assert package_util.get_version() == DVP_VERSION @staticmethod def test_get_virtualization_api_version(): - assert package_util.get_virtualization_api_version() == '1.7.0' + assert package_util.get_virtualization_api_version() == DVP_API_VERSION @staticmethod - def test_get_engine_api_version(): - assert package_util.get_engine_api_version_from_settings() == '1.12.0' + def test_get_engine_api_version(engine_api_version_string): + assert package_util.get_engine_api_version_from_settings() \ + == engine_api_version_string @staticmethod def test_get_build_api_version_json(): + major, minor, micro = ( + int(n) for n in DVP_API_VERSION.split('.')) build_api_version = { 'type': 'APIVersion', - 'major': 1, - 'minor': 7, - 'micro': 0 + 'major': major, + 'minor': minor, + 'micro': micro } assert package_util.get_build_api_version() == build_api_version @staticmethod - def test_get_engine_api_version_json(): - engine_api_version = { - 'type': 'APIVersion', - 'major': 1, - 'minor': 12, - 'micro': 0 - } - assert package_util.get_engine_api_version() == engine_api_version + def test_get_engine_api_version_json(engine_api): + assert package_util.get_engine_api_version() == engine_api @staticmethod def test_get_internal_package_root(): From d170f539f215d47adad2ed73a4a0145fbf147a27 Mon Sep 17 00:00:00 2001 From: Sourabh Date: Thu, 15 Sep 2022 17:48:39 +0530 Subject: [PATCH 2/3] DLPX-83062 Update engine version to 1.11.16 in develop branch --- .../main/python/dlpx/virtualization/_internal/settings.cfg | 2 +- .../test/python/dlpx/virtualization/_internal/conftest.py | 2 +- .../dlpx/virtualization/_internal/test_package_util.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/src/main/python/dlpx/virtualization/_internal/settings.cfg b/tools/src/main/python/dlpx/virtualization/_internal/settings.cfg index 93477cdc..c80f2be1 100644 --- a/tools/src/main/python/dlpx/virtualization/_internal/settings.cfg +++ b/tools/src/main/python/dlpx/virtualization/_internal/settings.cfg @@ -20,7 +20,7 @@ # versions in those packages until they are shipped out of band. # [General] -engine_api_version = 1.12.0 +engine_api_version = 1.11.16 distribution_name = dvp-tools package_author = Delphix namespace_package = dlpx diff --git a/tools/src/test/python/dlpx/virtualization/_internal/conftest.py b/tools/src/test/python/dlpx/virtualization/_internal/conftest.py index 3b05daae..57059fa9 100644 --- a/tools/src/test/python/dlpx/virtualization/_internal/conftest.py +++ b/tools/src/test/python/dlpx/virtualization/_internal/conftest.py @@ -710,7 +710,7 @@ def artifact_content(engine_api, virtual_source_definition, @pytest.fixture def engine_api(): - return {'type': 'APIVersion', 'major': 1, 'minor': 12, 'micro': 0} + return {'type': 'APIVersion', 'major': 1, 'minor': 11, 'micro': 16} @pytest.fixture diff --git a/tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py b/tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py index c17a3a5b..9d402e3b 100644 --- a/tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py +++ b/tools/src/test/python/dlpx/virtualization/_internal/test_package_util.py @@ -18,7 +18,7 @@ def test_get_virtualization_api_version(): @staticmethod def test_get_engine_api_version(): - assert package_util.get_engine_api_version_from_settings() == '1.12.0' + assert package_util.get_engine_api_version_from_settings() == '1.11.16' @staticmethod def test_get_build_api_version_json(): @@ -35,8 +35,8 @@ def test_get_engine_api_version_json(): engine_api_version = { 'type': 'APIVersion', 'major': 1, - 'minor': 12, - 'micro': 0 + 'minor': 11, + 'micro': 16 } assert package_util.get_engine_api_version() == engine_api_version From 6f08013af21bb3fbac52c66b3548882fe39c28c0 Mon Sep 17 00:00:00 2001 From: Sourabh Date: Mon, 19 Sep 2022 10:15:53 +0530 Subject: [PATCH 3/3] DLPX-83062 Update engine version to 1.11.16 in develop branch --- .../python/dlpx/virtualization/_internal/engine_version.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg b/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg index d57b4e49..d5cb24b4 100644 --- a/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg +++ b/tools/src/test/python/dlpx/virtualization/_internal/engine_version.cfg @@ -11,4 +11,4 @@ # This file also should not be updated manually with feature changes. # [General] -engine_api_version = 1.12.0 +engine_api_version = 1.11.16