-
Notifications
You must be signed in to change notification settings - Fork 198
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
8 changed files
with
104 additions
and
34 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
compile_dir=$1 | ||
|
||
echo "This is going into a file" > "${compile_dir}/${FILE_NAME}" |
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
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,50 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright 2019 The Kapitan Authors | ||
# SPDX-FileCopyrightText: 2020 The Kapitan Authors <kapitan-admins@googlegroups.com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
"compile tests" | ||
|
||
import unittest | ||
import os | ||
|
||
from tempfile import TemporaryDirectory | ||
from kapitan.resources import inventory | ||
from kapitan.cached import args | ||
from kapitan.targets import compile_target | ||
|
||
INSTALLATION_PATH = "examples/kubernetes" | ||
SEARCH_PATHS = [ | ||
os.getcwd(), | ||
INSTALLATION_PATH, | ||
] | ||
|
||
class CompileCodeTest(unittest.TestCase): | ||
def setUp(self): | ||
args.inventory_backend = "reclass" | ||
args.inventory_path = "inventory" | ||
args.inv = inventory([INSTALLATION_PATH]) | ||
|
||
def test_compile(self): | ||
target_name = "minikube-es" | ||
with TemporaryDirectory() as dir: | ||
target_obj = args.inv[target_name] | ||
compile_target( | ||
target_obj, | ||
SEARCH_PATHS, | ||
dir, | ||
None, | ||
None) | ||
|
||
for root, dirs, files in os.walk(dir): | ||
path = root.split(os.sep) | ||
print((len(path) - 1) * '---', os.path.basename(root)) | ||
for file in files: | ||
print(len(path) * '---', file) | ||
assert os.path.exists(os.path.join(dir, target_name, "script.sh")) | ||
|
||
|
||
|
||
|