Repository: coreos/ignition

Issue:
TMT Workflow is not respecting use_built_from_src input variable
# Bug #
TMT Workflow is not respecting use_built_from_src input variable. When github workflow is executed manually or thur the PR request, the use_built_from_src is not respected causing the workflow and TMT to always install the ignition package from the distribution instead of use igntion built it from source.

## Operating System Version ##
N/A

## Ignition Version ##
N/A

## Environment ##
N/A

What hardware/cloud provider/hypervisor is being used to run Ignition?
N/A

## Expected Behavior ##
When the workflow is executed without set the use_built_from_src or if it is set use_built_from_src=true, build ignition from source instead of install the distribution package.

## Actual Behavior ##
igniton package is always installed and used

## Reproduction Steps ##

  1. Execute the TMT workflow manually and check the logs to see the ignition package installed from the distribuiton.


## Other Information ##
N/A

Discussion:

Solution patch:
diff --git a/.github/workflows/tmt-tests.yml b/.github/workflows/tmt-tests.yml
index 354ec607..1738d1b2 100644
--- a/.github/workflows/tmt-tests.yml
+++ b/.github/workflows/tmt-tests.yml
@@ -24,7 +24,7 @@ on:
         default: ''
       use_built_from_src:
         description: 'Built ignition from source instead of install distro package'
-        required: true
+        required: false
         default: 'true'
 
 jobs:
@@ -41,6 +41,7 @@ jobs:
 
       - name: Set additional paths
         run: |
+          set -x -e -o pipefail
           echo "$HOME/.local/bin" >> $GITHUB_PATH
 
       - name: Install dependencies
@@ -51,7 +52,7 @@ jobs:
           pip install --user tmt
 
       - name: Build Ignition
-        if: ${{ github.event.inputs.use_built_from_src == 'true' }}
+        if: github.event.inputs.use_built_from_src == '' || github.event.inputs.use_built_from_src == 'true'
         run: |
           set -x -e -o pipefail
           make all
@@ -68,8 +69,8 @@ jobs:
           if [ -n "${{ github.event.inputs.plan_filter }}" ]; then
             PLAN_FILTER_PARAM="plan --filter '${{ github.event.inputs.plan_filter }}'"
           fi
-          if [ "${{ github.event.inputs.use_built_from_src }}" == "true" ]; then
-            CONTEXT_PARAM="--context use_built_from_src=${{ github.event.inputs.use_built_from_src }}"
+          if [ -z "${{ github.event.inputs.use_built_from_src }}" ] || [ "${{ github.event.inputs.use_built_from_src }}" == "true" ]; then
+            CONTEXT_PARAM="--context use_built_from_src=true"
           else
             CONTEXT_PARAM="--context use_built_from_src=false"
           fi



Test patch:
diff --git a/tests/tmt/plans/main.fmf b/tests/tmt/plans/main.fmf
index 08e6ef1f..ffc84028 100644
--- a/tests/tmt/plans/main.fmf
+++ b/tests/tmt/plans/main.fmf
@@ -12,7 +12,6 @@ prepare:
       # to set a environment variable to point to the ignition binary location.
       set -x -e -o pipefail
       echo "Preparing the test environment"
-      BIN_DESTINATION="/usr/local/bin"
       IGNITION_BIN_NAME="ignition"
       PARENT_DIR=$(dirname "${TMT_TREE}")
       IGNITION_BIN_FULL_PATH=$(find "${PARENT_DIR}" -type f -name "${IGNITION_BIN_NAME}")