-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add databricks workflow system to integration tests (#1565)
We want to add the Databricks workflow system to our integration tests so that we can be notified in case of any failure during RC testing. This PR copies the Databricks workflow system test from the Airflow repo and integrates it with our integration tests.
- Loading branch information
1 parent
e7e3f68
commit 8234cb7
Showing
6 changed files
with
47 additions
and
3 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
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,32 @@ | ||
from __future__ import annotations | ||
|
||
import argparse | ||
|
||
|
||
def remove_lines_after(file_path, target_line): | ||
""" | ||
Remove all lines in a file after the first occurrence of a specified target line. | ||
This function reads a file and rewrites it, keeping only the lines up to and including | ||
the first occurrence of the target line. All lines following the target line are removed. | ||
Args: | ||
file_path (str): The path to the file to be modified. | ||
target_line (str): The line after which all content in the file should be removed. | ||
""" | ||
with open(file_path) as input_file: | ||
lines = input_file.readlines() | ||
|
||
with open(file_path, "w") as output_file: | ||
for line in lines: | ||
if target_line in line: | ||
break | ||
output_file.write(line) | ||
|
||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("file_path", help="file path", type=str) | ||
args = parser.parse_args() | ||
target_line = "from tests.system.utils.watcher import watcher" | ||
remove_lines_after(args.file_path, target_line) |
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