-
Notifications
You must be signed in to change notification settings - Fork 37
Support running against Phel #873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,3 +28,4 @@ __pycache__/ | |
| poetry.lock | ||
| *.egg-info/ | ||
| .DS_Store | ||
| /vendor/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "require": { | ||
| "phel-lang/phel-lang": "dev-main" | ||
| }, | ||
| "minimum-stability": "dev" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Running the Phel tests | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - PHP 8.4+ & [Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos) | ||
|
|
||
| Install: | ||
| ``` | ||
| composer install | ||
| ``` | ||
|
|
||
| Tests live in `test/` (override via `phel-config.php`). | ||
|
|
||
| See also [Getting Started guide](https://phel-lang.org/documentation/getting-started/). | ||
|
|
||
| ## Running the test suite | ||
|
|
||
| Full suite: | ||
| ``` | ||
| ./vendor/bin/phel test | ||
| ``` | ||
| Specific test: | ||
| ``` | ||
| ./vendor/bin/phel test test/clojure/core_test/abs.cljc | ||
| ``` | ||
|
|
||
| If runner crashes before report, re-run with `--testdox` or `-v` to locate failing test. | ||
|
|
||
| See [Phel testing docs](https://phel-lang.org/documentation/testing/#running-tests). | ||
|
|
||
| ## Updating Phel version | ||
|
|
||
| `composer.json` tracks `dev-main` (latest [phel-lang](https://github.com/phel-lang/phel-lang/) HEAD): | ||
| ```json | ||
| { | ||
| "require": { | ||
| "phel-lang/phel-lang": "dev-main" | ||
| }, | ||
| "minimum-stability": "dev" | ||
| } | ||
| ``` | ||
|
|
||
| Pull latest: | ||
| ``` | ||
| composer update phel-lang/phel-lang | ||
| ``` | ||
|
|
||
| Pin specific commit (optional): | ||
| ``` | ||
| composer require "phel-lang/phel-lang:dev-main#<commit-hash>" | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?php | ||
| // Override Phel's default 'tests' TestDirs path | ||
| // Reference: https://phel-lang.org/documentation/configuration/ | ||
| return (new \Phel\Config\PhelConfig()) | ||
| ->setSrcDirs(['src']) | ||
| ->setTestDirs(['test']); |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,8 +5,8 @@ | |||||
| (when-var-exists ancestors | ||||||
|
|
||||||
| ; Some classes for testing ancestors by type inheritance | ||||||
| (def AncestorT #?(:cljs js/Object :lpy python/object :default Object)) | ||||||
| (def ChildT #?(:cljs :default :lpy basilisp.lang.set/PersistentSet :default clojure.lang.PersistentHashSet)) | ||||||
| (def AncestorT #?(:cljs js/Object :lpy python/object :phel ArrayIterator :default Object)) | ||||||
| (def ChildT #?(:cljs :default :lpy basilisp.lang.set/PersistentSet :phel RecursiveArrayIterator :default clojure.lang.PersistentHashSet)) | ||||||
|
||||||
| (def ChildT #?(:cljs :default :lpy basilisp.lang.set/PersistentSet :phel RecursiveArrayIterator :default clojure.lang.PersistentHashSet)) | |
| (def ChildT #?(:cljs js/Array :lpy basilisp.lang.set/PersistentSet :phel RecursiveArrayIterator :default clojure.lang.PersistentHashSet)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid point regarding :cljs branch that it may be confusing but it's not related to this PR and should be resolved separately.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,9 @@ | |
| [true "0" | ||
| true "1"] | ||
| :lpy | ||
| [true "0" | ||
| true "1"] | ||
| :phel | ||
| [true "0" | ||
| true "1"] | ||
| :default | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,10 @@ | |
| true 1N | ||
| true -1N | ||
| #?@(:cljs [] | ||
| :phel | ||
| [false 0/2 | ||
| false 1/2 | ||
| false -1/2] | ||
| :default | ||
| [true 0/2 | ||
| false 1/2 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
dev-mainwithout committing acomposer.lockmakes CI and local runs non-deterministic (upstream Phel changes can break the suite without any change in this repo). If stability is desired, pin to a tagged release or a specific commit and commit the resultingcomposer.lock; if tracking HEAD is desired, consider documenting/handling the expected flakiness explicitly.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"phel-lang/phel-lang": "dev-main"is intended so that fixing breakage on Phel side wouldn't require updating the pinned commit here.