-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI Cleanup and Parallel Testing (#3)
- Loading branch information
Showing
3 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import argparse | ||
import os | ||
|
||
def set_env_variable_from_string(input_string): | ||
if "ci-exactly:" in input_string: | ||
env_file = os.getenv('GITHUB_ENV') | ||
test_name = input_string.split("ci-exactly:")[1].strip() | ||
with open(env_file, "a") as myfile: | ||
myfile.write(f"TEST_FILE={test_name}") | ||
print(f'Successfully set TEST_FILE to: {test_name}') | ||
else: | ||
print('The PR body does not contain "ci-exactly:" so running all tests') | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser(description="Set TEST_FILE environment variable from PR body") | ||
parser.add_argument("--test", required=True, help="PR body containing 'ci-exactly:'") | ||
|
||
args = parser.parse_args() | ||
set_env_variable_from_string(args.test) |