-
Notifications
You must be signed in to change notification settings - Fork 358
Ensure description is coherent when only the main field is modified #1577
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
Open
djon2003
wants to merge
8
commits into
sabre-io:master
Choose a base branch
from
djon2003:fix_description_discrepency
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
18db635
Add method to remove the alternate description if not modified but th…
djon2003 a232ddd
Add docker support for unit tests
djon2003 a8a1dce
Remove debugging commented line
djon2003 d789d4f
Executed composer cs-fixer
djon2003 f877dc9
Add param description + rename parameter to be consistent
djon2003 7ab12d4
Add running local repository option
djon2003 430021d
Remove git warning
djon2003 0c283f8
Create local execution script
djon2003 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,22 @@ | ||
| FROM ubuntu:24.04 | ||
|
|
||
| # Install PHP | ||
| RUN apt update -y | ||
| RUN apt install ca-certificates -y | ||
| ADD php.sources /etc/apt/sources.list.d/ | ||
| RUN apt update -y | ||
| RUN apt install -y php7.4 php7.4-xml php7.4-mbstring php7.4-curl php7.4-sqlite3 | ||
| RUN apt install -y curl zip git | ||
|
|
||
| # Install composer | ||
| RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | ||
| RUN php composer-setup.php --version=2.8.3 | ||
| RUN mv composer.phar /usr/local/bin/composer | ||
| RUN rm composer-setup.php | ||
|
|
||
| # Setup tests | ||
| RUN mkdir /src/ | ||
| ADD run-tests.sh . | ||
| RUN chmod +x run-tests.sh | ||
|
|
||
| ENTRYPOINT ["/run-tests.sh"] |
This file contains hidden or 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,28 @@ | ||
| USAGE | ||
| ===== | ||
|
|
||
| - Install Docker | ||
|
|
||
| REPO | ||
| ---- | ||
|
|
||
| - Download the folder **/tests/docker** from the repository | ||
| - Goto that folder using a terminal | ||
| - Run `docker compose up` | ||
| - Run `docker run --rm -ti sabre-dav-unit-tests` | ||
|
|
||
| LOCAL | ||
| ----- | ||
|
|
||
| - Goto **$local_repo_path/tests/docker** using a terminal | ||
| - Run `docker compose up` | ||
| - Run either: | ||
| - `docker run --rm -ti -v $local_repo_path:/test-dir/ sabre-dav-unit-tests` | ||
| - `./run-local.sh` | ||
|
|
||
|
|
||
| DEV | ||
| --- | ||
|
|
||
| - Apply changes to Dockerfile | ||
| - Run `docker compose up --build` |
This file contains hidden or 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,8 @@ | ||
| services: | ||
| sabre-dav-unit-tests: | ||
| entrypoint: bash -c "echo Execute docker run -ti sabre-dav-unit-tests to start" | ||
| container_name: sabre-dav-unit-tests | ||
| build: | ||
| context: ./ | ||
| dockerfile: ./Dockerfile | ||
| image: sabre-dav-unit-tests:latest |
This file contains hidden or 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,34 @@ | ||
| Types: deb | ||
| URIs: https://ppa.launchpadcontent.net/ondrej/php/ubuntu/ | ||
| Suites: noble | ||
| Components: main | ||
| Signed-By: | ||
| -----BEGIN PGP PUBLIC KEY BLOCK----- | ||
| . | ||
| mQINBGYo0vEBEAC0Semxy5I2b8exRUxJfTKkHR4f5uyS0dTd9vYgMI5T3gsa7ypH | ||
| HtE+GiZC+T9m/F9h66+XJMxhuNsKRs7T2In5NSeso9H/ytlSTayUaBtCFfRp6y6b | ||
| 6ozuRBfqYJGxhjAnIzvNF/Wpp2BvfQm3OrQ7uJJrt5IvzLDC4jPxl/Xs3sTT+Hbk | ||
| bkKKprZ3xmy2enuwBaNWR/CUtAz3hbkzL1kGbhX9m3QidFJagVVdDw3aNEwo8ush | ||
| djWfF+BajNvpDFYJKBGQbCeagB753Baa5yIN62x+THLnLiKTMDS1e7U0ZDiV9671 | ||
| noTbtN5TeZeyfsEmeZ8X60x11JIP3yYHYZT70/DyTYX3WC9yQFyIgVOfRlGklMKI | ||
| k3TLMmtq8w5Hz1vovwzV7PzaQnmY+uNP2ZbAP4fJ3iFAj0L+u0i1nOFgTy0Lq058 | ||
| O/FjRrQxuceDDCF+9ThspXMw3Puvz8giuBDCdEda84uC7XWMdqgz/maLfFQjAmyP | ||
| Ixi1EMxMlHYyZajpR1cdCfrAIQlnQjHSWmyeCFgXPPfRA71aCcJ7oSrDjogW6Ahd | ||
| HRkQRKf1FF9BFzycgSQotfR+7CKfPQh1kghufM9W/spARzA709nGZjXJzgEJLQd3 | ||
| CDB6dIIxT/0YI36h3Qgfmiiw4twO24MMEqEEPIELz2WJKeWGkdQdcekpxQARAQAB | ||
| tB9MYXVuY2hwYWQgUFBBIGZvciBPbmTFmWVqIFN1csO9iQJOBBMBCgA4FiEEuNx+ | ||
| U5RmVu+85MHdcdrqq0rUyrYFAmYo0vECGwMFCwkIBwIGFQoJCAsCBBYCAwECHgEC | ||
| F4AACgkQcdrqq0rUyrYOPQ/+IArA4s1J3op/w7cXek0ieFHWHFDrxPYS+78/LF/J | ||
| LoYZw0nIU5Ovr+LzehFMIQU6esgPXwbeCVgwLwat57augAkAYWT0UzH5dE6RKAGr | ||
| C2vsHWVfPhQn6UndfzwXc0mTLGQni25aQaZ6k60Dbm/vblejrTQrtAUWoMO3Z1cr | ||
| NDGJ3Z9DCxtr2o9gRYUI6HwLHJtobTIeI5xsr5x+GvXiIAVCPa3ZEuRL6jMQfqfS | ||
| C43mpuiS1kGgsnQLs2DbN7EFCfiJoNX1QzZu25zg+IS9PXbCJnheZWnH0rwUSb/N | ||
| hZPcSefGlNlhr824OfT30v79hQnw59XbsfV270O9jPbD4kttN+OiszbU66zsuiOh | ||
| BO46XCckQPqDkBMw56GPFuVrQgGb1thXvn67URJgPyJhwauBWKPNAJ9Ojuo+yVq/ | ||
| hdR1VNWThXQbZgaGSWrbjt6FdYtQb9VX88uu5gFDmr180HogHNUDUcqNLLdnjfFs | ||
| 4DyJlusQ5I/a7cQ7nlkNgxAmHszwO/mGLBuGljDUYkwZDW9nqP1Q5Q2jMtrhgXvR | ||
| 2SOtufvecUbB7+eoRSaOnu7CNMATG6LocFEMzhKUde1uZTfWSqnYEcdqoFJMi46y | ||
| qaNxhiNLsQ5OBMbgSp2zCbQxRBdITMVvBR5YjCetUIGEs6T1yQ5wh5Xpoi34ShHn | ||
| v38= | ||
| =kFlZ | ||
| -----END PGP PUBLIC KEY BLOCK----- |
This file contains hidden or 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,3 @@ | ||
| #!/bin/bash | ||
|
|
||
| docker run -ti --rm -v $(realpath "$(dirname $0)/../../"):/test-dir/ sabre-dav-unit-tests |
This file contains hidden or 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,57 @@ | ||
| #!/bin/bash | ||
|
|
||
| function executeTests() | ||
| # $1 = Source directory | ||
| { | ||
| src="$1" | ||
| ( | ||
| cd "$src" | ||
| composer install | ||
|
|
||
| mkdir -p vendor/sabre/http/tests/www | ||
| php -S localhost:8000 -t vendor/sabre/http/tests/www & | ||
|
|
||
| composer phpunit | ||
| ) | ||
| } | ||
|
|
||
| function downloadRepo() | ||
| { | ||
| local repoUrl= | ||
| while [ -z "$repoUrl" ] | ||
| do | ||
| read -p "Please enter public repository URL:" repoUrl | ||
|
|
||
| if [ -z "$repoUrl" ]; then echo "Repository URL is mandatory"; fi | ||
| done | ||
|
|
||
| local branchName= | ||
| read -p "Enter the branch name [default: master]" branchName | ||
| branchName=${branchName:-master} | ||
|
|
||
| echo "Are you sure you want to test with?" | ||
| echo "URL: $repoUrl" | ||
| echo "Branch: $branchName" | ||
| read -p "[y/N]" confirm | ||
|
|
||
| if [ "$confirm" != "Y" ] && [ "$confirm" != "y" ]; then | ||
| echo "Cancelling test run" | ||
| exit | ||
| fi | ||
|
|
||
| git clone -b "$branchName" --single-branch --depth 1 "$repoUrl" /src/ | ||
| } | ||
|
|
||
| echo "Starting test container" | ||
|
|
||
| src=/test-dir/ | ||
| if [ -d $src ]; then | ||
| echo "Using local volume" | ||
| git config --global --add safe.directory /test-dir | ||
| else | ||
| src=/src/ | ||
| echo "Using repository" | ||
| downloadRepo | ||
| fi | ||
|
|
||
| executeTests "$src" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you please add some unit test(s) that will exercise this new code block?
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.
I tried to run actual tests either directly from a Windows terminal or WSL, but I am getting
file_put_contents(/MY_PATH/../tempcol/test.txt): Failed to open stream: No such file or directoryI tried everything I thought. Nothing works.
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.
Running
composer installfrom WSL gives: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.
I don't know what version of
composeryou get in WSL.To update to the latest
composerI do:sudo composer self-updateI have:
I have an actual Ubuntu laptop, no Windows. The CI runs in Ubuntu Linux, no Windows anywhere. Maybe use VirtualBox and create a full Ubuntu VM?
The "Failed to open stream" message is maybe coming from a line in ServerPropsTest.php
SABRE_TEMPDIRshould be a constant__DIR__.'/../temp/'that already has/on the end, but somehow the/must be missing and the code ends up trying to write to a directory calledtestcol.Try adding a
/in front ofcolUh oh!
There was an error while loading. Please reload this page.
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.
I created myself a Docker container to run the unit tests. Is this a normal execution result? (I still did not add mine, I will when I will be sure that this is the normal expections). I will add this Dockerfile with my PR so others could use it to test easily.
The docker is setup using Ubuntu 24.04, with your version of PHP and composer.
I have the same result with or without running
php -S localhost:8000 -t vendor/sabre/http/tests/www.BTW, the last part of the path (vendor/sabre/http/tests/www) does not exist when:
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.
@phil-davis I pushed a commit including docker support for the unit tests.
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.
That is the normal unit test result. Some unit tests need exgtra environment set up, so they are skipped by default (the "S").