From 28995cd7289256be3d3b8f820d438ddec36778b3 Mon Sep 17 00:00:00 2001 From: Kuan-Po Tseng Date: Mon, 27 Nov 2023 16:14:08 +0100 Subject: [PATCH] [YUNIKORN-2170] e2e test setup takes a lot of time (#732) Empty-Commit Closes: #732 Signed-off-by: Peter Bacsko --- .github/workflows/pre-commit.yml | 9 +++++++++ scripts/run-e2e-tests.sh | 13 +++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 67aead9d4..8e1724455 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -55,6 +55,15 @@ jobs: echo "vm.nr_hugepages = 1024" | sudo tee -a /etc/sysctl.conf sudo sysctl -p sudo sysctl -a | grep vm.nr_hugepages + - name: Cache and Restore e2e required tools + id: cache + uses: actions/cache@v3 + with: + path: | + tools + key: ${{ runner.os }}-e2e-${{ hashFiles('Makefile') }} + restore-keys: | + ${{ runner.os }}-e2e- - run: ./scripts/run-e2e-tests.sh -a "test" -n "yk8s" -v "kindest/node:${KIND_NODE_IMAGE}" ${KIND_EXTRA_ARGS} env: KIND_NODE_IMAGE: ${{ matrix.k8s }} diff --git a/scripts/run-e2e-tests.sh b/scripts/run-e2e-tests.sh index f245ab1a0..78615de9a 100755 --- a/scripts/run-e2e-tests.sh +++ b/scripts/run-e2e-tests.sh @@ -16,9 +16,10 @@ # See the License for the specific language governing permissions and #limitations under the License. -HELM=tools/helm -KIND=tools/kind -KUBECTL=tools/kubectl +TOOLS_DIRECTORY=tools +HELM=$TOOLS_DIRECTORY/helm +KIND=$TOOLS_DIRECTORY/kind +KUBECTL=$TOOLS_DIRECTORY/kubectl GO="${GO:-go}" export GO @@ -71,7 +72,11 @@ function check_docker() { } function install_tools() { - make tools + if [ -d "$TOOLS_DIRECTORY" ]; then + echo "tools directory exists. Skipping make tools." + else + make tools + fi } function install_cluster() {