Skip to content

Commit

Permalink
rm spinner simulation for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdAmmar committed Nov 15, 2024
1 parent 35d0df0 commit f569587
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion tests/lunch_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,32 @@ def prep_inp(self):
print_col("File 'inp/{}' does not exist.".format(inp_file), "red")
sys.exit(1)

def run_ci(self):

try:

os.chdir('..')

command = [
'python{}'.format(PYTHON_VERSION), 'PyDuck.py',
'--working_dir', '{}'.format(self.workdir),
'-x', '{}'.format(self.mol),
'-b', '{}'.format(self.basis),
'-m', '{}'.format(self.multip)
]

file_out = "{}/{}/{}_{}_{}.out".format(self.workdir, self.methd, self.mol, self.multip, self.basis)
with open(file_out, 'w') as fobj:
result = subprocess.run(command, stdout=fobj, stderr=subprocess.PIPE, text=True)
if result.stderr:
print("Error output:", result.stderr)

os.chdir('tests')

except Exception as e:

print_col(f"An error occurred: {str(e)}", "red")

def run(self):

def display_spinner():
Expand Down Expand Up @@ -216,6 +242,7 @@ def main():
if not os.path.exists("{}/input".format(work_path)):
os.makedirs("{}/input".format(work_path))

is_ci = os.getenv('CI')
test_failed = False
for mol in molecules:

Expand Down Expand Up @@ -244,7 +271,10 @@ def main():

New_Quack_Job = Quack_Job(mol_name, mol_mult, basis_name, mol_geom, methd, work_path)
New_Quack_Job.prep_inp()
New_Quack_Job.run()
if is_ci:
New_Quack_Job.run_ci()
else:
New_Quack_Job.run()

test_failed_ = False
New_Quack_Job.check_data(basis_data, test_failed_)
Expand Down

0 comments on commit f569587

Please sign in to comment.