Skip to content

Commit

Permalink
Fixes for replay and compile test (#86)
Browse files Browse the repository at this point in the history
* remove duplicate trigger on pull request

* fix reporting

* make test continue if test fails

* add process wide error_state

* comment out test case for process without dockerization

* add port to annotation injection in code

* fix check
  • Loading branch information
kartikeytewari-ul committed Jun 28, 2024
1 parent 9a74c01 commit 59a935d
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 197 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/compile_target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: compile_target

on:
push:
pull_request:
branches: [main]

jobs:
build:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/replay_target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: replay_target

on:
push:
pull_request:
branches: [main]

jobs:
build:
Expand Down
20 changes: 11 additions & 9 deletions src/test/python/Target.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

# define constants
main_method_identifier = "public static void main"
unlogged_annotation = "@Unlogged"
unlogged_annotation = "@Unlogged(port = " + "12100" + ")"
unlogged_annotation_base_string = "Unlogged"
unlogged_import = "import io.unlogged.Unlogged;"

class ReplayTest:
Expand Down Expand Up @@ -106,7 +107,7 @@ def modify_main(self):
# check annotation
annotation_present = False
for line in file:
if (unlogged_annotation in line):
if (unlogged_annotation_base_string in line):
annotation_present = True

# add annotation
Expand Down Expand Up @@ -166,17 +167,18 @@ def check_replay(self):
print ("Test name = " + local_test)
print (" Expected value = " + expected_response_dict[local_test].name)
print (" Actual value = " + actual_response_dict[local_test].name)
print ("----")

if (expected_response_dict[local_test] == actual_response_dict[local_test]):
print (" The test executed as expected")
else:
replay_fail.append(test_name)
print(" The test did not executed as expected")
if (expected_response_dict[local_test] != actual_response_dict[local_test]):
replay_fail.append(local_test)

if (len(replay_fail) == 0):
print ("All tests passed succesfully")
return False

else:
print ("Some tests failed. There are:")
print ("Replay tests have failed for " + self.test_repo_name + ". Fail count = " + str(len(replay_fail)))
for local_test in replay_fail:
print ("Test Case: " + local_test)
raise Exception("Replay tests have failed")

return True
2 changes: 1 addition & 1 deletion src/test/python/compile_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def compile_target (target):
if "io.projectreactor" in dependencies:
raise Exception("Found reactor core in a Non reactive project " + target.test_repo_name + " - Failing")
else :
print("Reactor core not found on NonReactive project - Passsing")
print("Reactor core not found on NonReactive project - Passing")
else:
if "io.projectreactor" in dependencies:
print("Reactor core found on Reactive project - Passing")
Expand Down
Loading

0 comments on commit 59a935d

Please sign in to comment.