Skip to content

Commit

Permalink
test options
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelyr committed Mar 27, 2024
1 parent 0a1f878 commit 5915ffb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
40 changes: 29 additions & 11 deletions .github/workflows/globusTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,38 @@
from globus_compute_sdk import Executor
import os

endpoint = '2e3dc4ed-3c37-4fe1-84c6-edc51c9f08f5'
endpoint = '0dd4499a-8d76-4977-bae9-841e4bb2f616'
gce = Executor(endpoint_id = endpoint)
# print("Executor : ", gce)

def run_test():
import os
# return os.popen("./build-test-omega_h.sh").read()
result = os.popen("cat omega_h-test-result/LastTest.log").read()
summary = os.popen("cat omega_h-test-result/TestSummary.log").read()
return (summary, result)
import subprocess

install = subprocess.run(["./install-test.sh omega_h-test master"], shell=True, encoding="utf_8", stdout=subprocess.PIPE)
if install.returncode == 1:
return (install, "", "")

test = subprocess.run(["./install-test.sh omega_h-test build-omegah-perlmutter-cuda"], shell=True, encoding="utf_8", stdout=subprocess.PIPE)
if test.returncode == 1:
return (install, test, "")

with open("omega_h-test-result/LastTest.log","r") as f:
result = f.read()

return (install, test, result)

# print(run_test()[1])
future = gce.submit(run_test)
# print(future.result()[0])

os.popen("mkdir -p omega_h-test-result").read()
with open("omega_h-test-result/LastTest.log", "w") as text_file:
text_file.write("%s" % future.result()[0])
with open("omega_h-test-result/TestSummary.log", "w") as text_file:
text_file.write("%s" % future.result()[1])

result = future.result()

with open("omega_h-test-result/Build.log", "w") as text_file:
text_file.write("%s" % result[0].stdout)
if result[0].returncode == 0:
with open("omega_h-test-result/LastTest.log", "w") as text_file:
text_file.write("%s" % result[1].stdout)
if result[1].returncode == 0:
with open("omega_h-test-result/TestSummary.log", "w") as text_file:
text_file.write("%s" % result[2])
4 changes: 4 additions & 0 deletions .github/workflows/perlmutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ jobs:
export FUNCX_SDK_CLIENT_SECRET="$GLOBUS_SECRET"
python globusTests.py
- name: print build log
working-directory: omega_h/.github/workflows
run: cat omega_h-test-result/Build.log

- name: print test summary
working-directory: omega_h/.github/workflows
run: cat omega_h-test-result/TestSummary.log
Expand Down

0 comments on commit 5915ffb

Please sign in to comment.