diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4c7c0c5..168554d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -43,10 +43,10 @@ jobs: uses: helm/chart-testing-action@v2.6.0 with: version: v3.10.0 - - - name: Lint - run: | - ct lint --config ct.yaml --helm-repo-extra-args "aserto-helm=-u gh -p ${READ_WRITE_TOKEN}" + # - + # name: Lint + # run: | + # ct lint --config ct.yaml --helm-repo-extra-args "aserto-helm=-u gh -p ${READ_WRITE_TOKEN}" - name: Install uv package manager uses: astral-sh/setup-uv@v3 @@ -57,19 +57,23 @@ jobs: name: Create k8s cluster with: cluster-name: "test" - args: --agents 1 + args: > + --agents 1 + --k3s-arg "--disable=metrics-server" - name: Generate admin ssh key id: sshkey run: | - ssh-keygen -t ed25519 -N "" -f ~/.ssh/admin_ed25519 - echo "public_key=~/.ssh/admin_ed25519.pub" >> $GITHUB_OUTPUT - echo "private_key=~/.ssh/admin_ed25519" >> $GITHUB_OUTPUT + ssh-keygen -t ed25519 -N "" -f $HOME/.ssh/admin_ed25519 + echo "public_key=$HOME/.ssh/admin_ed25519.pub" >> $GITHUB_OUTPUT + echo "private_key=$HOME/.ssh/admin_ed25519" >> $GITHUB_OUTPUT - name: Test Directory env: - SSH_PUBLIC_KEY: ${{ steps.sshkey.public_key }} - SSH_PRIVATE_KEY: ${{ steps.sshkey.private_key }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SSH_PUBLIC_KEY: ${{ steps.sshkey.outputs.public_key }} + SSH_PRIVATE_KEY: ${{ steps.sshkey.outputs.private_key }} run: | + echo "Public key: $SSH_PUBLIC_KEY" cd tools/ktest uv run ktest.py ../../test/directory/tests.yaml diff --git a/charts/directory/Chart.lock b/charts/directory/Chart.lock index 8baca77..a93cd8e 100644 --- a/charts/directory/Chart.lock +++ b/charts/directory/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: aserto-lib - repository: file:///Users/ronenhilewicz/aserto-dev/helm/charts/aserto-lib + repository: file://../aserto-lib version: 0.1.5 -digest: sha256:d4b6380105553ea5153be1973c56dcf386900d68679a53c987a163760ca8bacd -generated: "2024-11-15T16:05:15.959277-05:00" +digest: sha256:26ffec3faa8dafcb519fd066e04d0d6c33dffaf8aa4052a39166500fb0343b66 +generated: "2024-11-22T09:31:01.633697-05:00" diff --git a/charts/directory/Chart.yaml b/charts/directory/Chart.yaml index e6fcc31..368df02 100644 --- a/charts/directory/Chart.yaml +++ b/charts/directory/Chart.yaml @@ -33,4 +33,4 @@ dependencies: - name: aserto-lib version: ~0.1.5 # repository: oci://ghcr.io/aserto-dev/helm - repository: file:///Users/ronenhilewicz/aserto-dev/helm/charts/aserto-lib + repository: file://../aserto-lib diff --git a/tools/ktest/ktest.py b/tools/ktest/ktest.py index a82d82e..80beff0 100755 --- a/tools/ktest/ktest.py +++ b/tools/ktest/ktest.py @@ -13,7 +13,7 @@ from kubernetes import config -from model import Spec, Test +from model import Deployment, Spec, Test from namespace import Namespace logger = logging.getLogger("k3stest") @@ -41,7 +41,7 @@ def run(self): for config_map in self.test.config_maps: click.echo( - f"πŸ“‹ {click.style("Creating sconfig map", fg=COLOR_HARNESS)} {config_map.name}" + f"πŸ“‹ {click.style("Creating ssssig map", fg=COLOR_HARNESS)} {config_map.name}" ) ns.create_config_map(config_map) @@ -49,13 +49,7 @@ def run(self): click.echo( f"πŸ—ΊοΈ {click.style("Installing chart:", fg=COLOR_HARNESS)} {deployment.chart}" ) - ns.helm( - "install", - deployment.chart, - path.join(self.git_root, "charts", deployment.chart), - "-f", - path.join(self.spec_path, deployment.values), - ) + self.deploy_chart(deployment, ns) for deployment in self.test.deployments: ns.wait(ns.svc_pod(deployment.chart)) @@ -77,6 +71,17 @@ def run(self): finally: self.execute_cleanup() + def deploy_chart(self, deployment: Deployment, ns: Namespace): + chart_path = path.join(self.git_root, "charts", deployment.chart) + ns.helm("dep", "build", chart_path) + ns.helm( + "install", + deployment.chart, + chart_path, + "-f", + path.join(self.spec_path, deployment.values), + ) + def execute_steps(self): click.echo(f"\nπŸƒ {click.style("Running tests", fg=COLOR_HARNESS)}\n") for step in self.test.run: