Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: retry command substitution on Windows. #804

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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