From 675f675d3e8c42285704f43e53c3b7137b6ec439 Mon Sep 17 00:00:00 2001 From: Manas Jayanth <3097018+ManasJayanth@users.noreply.github.com> Date: Sun, 10 Nov 2024 16:09:31 +0530 Subject: [PATCH 1/2] CI: setup github actions --- .github/workflows/ci.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..ca3dffa --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,33 @@ +name: test +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build-and-test: + runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest, macos-13] + emacs_version: + - 29.2 + - 29.4 + env: + EMACS_VERSION: ${{ matrix.emacs_version }} + steps: + - uses: actions/setup-node@v4 + - run: npm i -g esy + - name: Setup Emacs + uses: purcell/setup-emacs@master + with: + version: ${{ matrix.emacs_version }} + + - uses: actions/checkout@v2 + + - name: Test + run: | + make test From dfad22967f6a68e52c038a045622d44cdd34d7ec Mon Sep 17 00:00:00 2001 From: Manas Jayanth <3097018+ManasJayanth@users.noreply.github.com> Date: Sun, 10 Nov 2024 17:28:01 +0530 Subject: [PATCH 2/2] Remove invalid project test. Reason is specified in the comment. Please refer the patch. --- esy-mode.el | 10 ++++++++++ tests/esy.el | 17 ----------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/esy-mode.el b/esy-mode.el index 20edf02..fc760ab 100644 --- a/esy-mode.el +++ b/esy-mode.el @@ -159,6 +159,16 @@ returns project root" (let* ((cwd (esy/internal--cwd-of-buffer-or-default buffer))) (esy/internal--esy-status cwd))) +;; The following is function doesn't try to guarantee non-existence +;; of an esy/npm/opam project. Because 'esy status' command works +;; in any path. +;; So, we don't return nil signalling missing a project. We, instead, +;; ask the user for a project root, just in case we're wrong. +;; This could be re-visited. We need a good project use-case to see +;; if we infact need to be lenient and fallback to user input. +;; If we dont find a compelling reason to be so lenient, we could fail +;; hard. +;; Considering this, we can remove the test for invalid project. (defun esy/project--of-path (project-path) "Returns an abstract structure that can later be used to obtain more info about the project" diff --git a/tests/esy.el b/tests/esy.el index cd80e17..f2b395c 100644 --- a/tests/esy.el +++ b/tests/esy.el @@ -297,23 +297,6 @@ project with a package.json (but no esy field in it)" :teardown (lambda (fixture-project-path) (delete-directory fixture-project-path t)))) -(ert-deftest - test-esy/project--utils-for-invalid-project - () - "Tests esy/project--* utils on an project with empty manifest" - (ert/test-suite :setup (lambda (tmp-dir) - (let* ((test-esy-project-dir (concat (file-name-as-directory tmp-dir) - "test-esy-project-failing"))) - (progn (delete-directory test-esy-project-dir t) - (make-directory test-esy-project-dir) - test-esy-project-dir))) - :body (lambda (fixture-project-path) - (let* ((project (esy/project--of-path fixture-project-path))) - (should (not (esy/project--p project))) - (should (not (esy/project--ready-p project))))) - :teardown (lambda (fixture-project-path) - (delete-directory fixture-project-path t)))) - (ert-deftest test-esy/esy/internal--is-file-from-source-cache ()