Skip to content

Commit

Permalink
Fix: retry command substitution. (#804)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@dblock.org>
  • Loading branch information
dblock authored Oct 26, 2021
1 parent f7f9d00 commit d7ae0bf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/build_workflow/build_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import argparse
import logging
import os
import sys


Expand Down Expand Up @@ -76,7 +75,7 @@ def __init__(self):
self.keep = args.keep
self.platform = args.platform
self.architecture = args.architecture
self.script_path = sys.argv[0].replace(os.path.sep + os.path.join("src", "run_build.py"), f"{os.path.sep}build.sh")
self.script_path = sys.argv[0].replace("/src/run_build.py", "/build.sh")

def component_command(self, name):
return " ".join(
Expand Down
3 changes: 1 addition & 2 deletions src/ci_workflow/ci_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import argparse
import logging
import os
import sys


Expand Down Expand Up @@ -46,7 +45,7 @@ def __init__(self):
self.component = args.component
self.keep = args.keep
self.logging_level = args.logging_level
self.script_path = sys.argv[0].replace(os.path.sep + os.path.join("src", "run_ci.py"), f"{os.path.sep}ci.sh")
self.script_path = sys.argv[0].replace("/src/run_ci.py", "/ci.sh")

def component_command(self, name):
return " ".join(
Expand Down
6 changes: 2 additions & 4 deletions tests/tests_build_workflow/test_build_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

class TestBuildArgs(unittest.TestCase):

BUILD_PY = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..", "src", "run_build.py"))
BUILD_PY = "./src/run_build.py"

BUILD_SH = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..", "build.sh"))
BUILD_SH = "./build.sh"

OPENSEARCH_MANIFEST = os.path.realpath(
os.path.join(
Expand Down Expand Up @@ -83,8 +83,6 @@ def test_architecture(self):

@patch("argparse._sys.argv", [BUILD_PY, OPENSEARCH_MANIFEST, "--component", "xyz"])
def test_script_path(self):
self.assertTrue(os.path.isfile(self.BUILD_PY))
self.assertTrue(os.path.isfile(self.BUILD_SH))
self.assertEqual(BuildArgs().script_path, self.BUILD_SH)

@patch("argparse._sys.argv", [BUILD_PY, OPENSEARCH_MANIFEST])
Expand Down
6 changes: 2 additions & 4 deletions tests/tests_ci_workflow/test_ci_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

class TestCiArgs(unittest.TestCase):

CI_PY = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..", "src", "run_ci.py"))
CI_PY = "./src/run_ci.py"

CI_SH = os.path.realpath(os.path.join(os.path.dirname(__file__), "..", "..", "ci.sh"))
CI_SH = "./ci.sh"

OPENSEARCH_MANIFEST = os.path.realpath(
os.path.join(
Expand Down Expand Up @@ -58,8 +58,6 @@ def test_component(self):

@patch("argparse._sys.argv", [CI_PY, OPENSEARCH_MANIFEST, "--component", "xyz"])
def test_script_path(self):
self.assertTrue(os.path.isfile(self.CI_PY))
self.assertTrue(os.path.isfile(self.CI_SH))
self.assertEqual(CiArgs().script_path, self.CI_SH)

@patch("argparse._sys.argv", [CI_PY, OPENSEARCH_MANIFEST])
Expand Down

0 comments on commit d7ae0bf

Please sign in to comment.