-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
82 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- name: example | ||
shell: bash | ||
run: scripts/ci-test.sh | ||
run: scripts/ci-test.py |
This file was deleted.
Oops, something went wrong.
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,61 @@ | ||
#!/usr/bin/python3 | ||
|
||
import json | ||
import os | ||
import subprocess | ||
|
||
# Navigate to tests/simple_flow | ||
os.chdir('tests/simple_flow') | ||
|
||
# Run bazel clean --expunge | ||
subprocess.run(['bazel', 'clean', '--expunge'], check=True) | ||
|
||
# Run bazel build ... | ||
subprocess.run(['bazel', 'build', '...'], check=True) | ||
|
||
# Calculate SHA_A | ||
with open('bazel-bin/test_assemble_simple_merger_manifest.json', 'rb') as f: | ||
SHA_A = subprocess.run(['shasum', '-a', '256'], stdin=f, capture_output=True, check=True).stdout.strip() | ||
|
||
# Load JSON file | ||
with open('bazel-bin/test_assemble_simple_merger_config.json') as json_file: | ||
data = json.load(json_file) | ||
|
||
# Check Cmd, Labels, and User fields | ||
cmd = data['config']['Cmd'] | ||
labels = data['config']['Labels'] | ||
user = data['config']['User'] | ||
|
||
# Expected values | ||
expected_cmd = ["/usr/bin/my_app"] | ||
expected_labels = {"label1": "foo", "label2": "bar"} | ||
expected_user = "nfbasic" | ||
|
||
assert(cmd == expected_cmd) | ||
assert(labels == expected_labels) | ||
assert(user == expected_user) | ||
|
||
# Run bazel clean --expunge | ||
subprocess.run(['bazel', 'clean', '--expunge'], check=True) | ||
|
||
# Run bazel build ... | ||
subprocess.run(['bazel', 'build', '...'], check=True) | ||
|
||
# Calculate SHA_B | ||
with open('bazel-bin/test_assemble_simple_merger_manifest.json', 'rb') as f: | ||
SHA_B = subprocess.run(['shasum', '-a', '256'], stdin=f, capture_output=True, check=True).stdout.strip() | ||
|
||
# Compare SHA_A and SHA_B | ||
if SHA_A != SHA_B: | ||
print("expected same sha but got") | ||
print(SHA_A) | ||
print(SHA_B) | ||
exit(1) | ||
else: | ||
print(f"[ok] SHA256 matched {SHA_A}") | ||
|
||
# Navigate to tests/override_tools | ||
os.chdir('../../tests/override_tools') | ||
|
||
# Run bazel query ... | ||
subprocess.run(['bazel', 'query', '...'], check=True) |
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