From 42fe4baf1802729073d3549a9559748aa3047280 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Thu, 5 Jan 2023 19:44:22 +0100 Subject: [PATCH] Fix tailing newline by not created it in the first place --- .github/workflows/ansible-test-plugins.yml | 4 ++-- Makefile | 4 ++-- .../targets/setup_controller/tasks/setvars.yml | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ansible-test-plugins.yml b/.github/workflows/ansible-test-plugins.yml index 7cae151..fd9422e 100644 --- a/.github/workflows/ansible-test-plugins.yml +++ b/.github/workflows/ansible-test-plugins.yml @@ -125,9 +125,9 @@ jobs: ansible-core-version: ${{ matrix.ansible }} pre-test-cmd: >- >&2 echo Setting db_engine_version to ${{ matrix.db_engine_version }}...; - echo "${{ matrix.db_engine_version }}" > tests/integration/db_engine_version; + echo -n "${{ matrix.db_engine_version }}" > tests/integration/db_engine_version; >&2 echo Setting Connector version to ${{ matrix.connector }}...; - echo "${{ matrix.connector }}" > tests/integration/connector + echo -n "${{ matrix.connector }}" > tests/integration/connector target-python-version: ${{ matrix.python }} testing-type: integration diff --git a/Makefile b/Makefile index d02cf6e..d7e8e45 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ .PHONY: test-integration test-integration: - echo "mysql:8.0.22" > tests/integration/db_engine_version - echo "pymysql==0.9.3" > tests/integration/connector + echo -n "mysql:8.0.22" > tests/integration/db_engine_version + echo -n "pymysql==0.9.3" > tests/integration/connector podman run \ --detach \ --name primary \ diff --git a/tests/integration/targets/setup_controller/tasks/setvars.yml b/tests/integration/targets/setup_controller/tasks/setvars.yml index 0fe4351..d834bca 100644 --- a/tests/integration/targets/setup_controller/tasks/setvars.yml +++ b/tests/integration/targets/setup_controller/tasks/setvars.yml @@ -12,18 +12,18 @@ {{ lookup( 'file', '/root/ansible_collections/community/mysql/tests/integration/connector' - ) | trim }} + ) }} db_engine_version: > {{ lookup( 'file', '/root/ansible_collections/community/mysql/tests/integration/db_engine_version' - ) | trim }}" + ) }}" - name: "{{ role_name }} | Setvars | Set Fact using above facts" ansible.builtin.set_fact: connector_ver: "{{ connector_name.split('=')[2].strip() }}" - db_engine: "{{ db_engine_version | split(':') | first }}" - db_version: "{{ db_engine_version | split(':') | last }}" + db_engine: "{{ db_engine_version.split(':')[0].strip() }}" + db_version: "{{ db_engine_version.split(':')[1].strip() }}" mysql_command: >- mysql -h{{ gateway_addr }}