Skip to content

Commit c1d5236

Browse files
committed
Removing retries logic
1 parent 407e707 commit c1d5236

1 file changed

Lines changed: 19 additions & 29 deletions

File tree

tests/e2e_tests.py

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -129,22 +129,6 @@ def replace_command(args, line):
129129
return line
130130

131131

132-
def execute_task(task):
133-
result = subprocess.Popen(
134-
task,
135-
shell=True,
136-
stdin=subprocess.PIPE,
137-
stdout=subprocess.PIPE,
138-
stderr=subprocess.STDOUT,
139-
cwd=os.path.dirname(__file__),
140-
)
141-
142-
# pass in a "y" for things that prompt for it (--ndts, etc)
143-
text = result.communicate(input=b"y")[0]
144-
return_code = result.returncode
145-
return text, return_code
146-
147-
148132
def run_e2e_tests(args):
149133
console = Console()
150134
tasks = generate_commands(args)
@@ -163,7 +147,6 @@ def run_e2e_tests(args):
163147
start_time = time()
164148
passed = 0
165149
failed = 0
166-
tries = 3
167150

168151
while tasks:
169152
task = str(tasks.pop(0))
@@ -172,18 +155,25 @@ def run_e2e_tests(args):
172155
task = task.replace('"', "'")
173156

174157
console.log(f"Running command: {task}")
175-
failure = True
176-
for i in range(tries):
177-
text, return_code = execute_task(task)
178-
if return_code == 0 and "Traceback (most recent call last)" not in text.decode("utf-8"):
179-
console.log(f"└─$ {task.strip()} [bold green]:heavy_check_mark:[/]")
180-
failure = False
181-
passed += 1
182-
break
183-
else:
184-
console.log(f"[bold red]{task.strip()} :cross_mark: Try {i + 1}/3[/]")
185-
if failure:
186-
console.log(f"[bold red]TASK FAILED {tries} TIMES, CONTINUING[/]")
158+
result = subprocess.Popen(
159+
task,
160+
shell=True,
161+
stdin=subprocess.PIPE,
162+
stdout=subprocess.PIPE,
163+
stderr=subprocess.STDOUT,
164+
cwd=os.path.dirname(__file__),
165+
)
166+
167+
# pass in a "y" for things that prompt for it (--ndts, etc)
168+
text = result.communicate(input=b"y")[0]
169+
return_code = result.returncode
170+
171+
if return_code == 0 and "Traceback (most recent call last)" not in text.decode("utf-8"):
172+
console.log(f"└─$ {task.strip()} [bold green]:heavy_check_mark:[/]")
173+
passed += 1
174+
break
175+
else:
176+
console.log(f"[bold red]{task.strip()} :cross_mark:[/]")
187177
failures.append(task.strip())
188178
failed += 1
189179

0 commit comments

Comments
 (0)