Skip to content
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

[4.2 RC1] Feed display module not working #38312

Merged
merged 9 commits into from
Aug 19, 2022
Merged

[4.2 RC1] Feed display module not working #38312

merged 9 commits into from
Aug 19, 2022

Conversation

conseilgouz
Copy link
Contributor

@conseilgouz conseilgouz commented Jul 20, 2022

Pull Request for Issue #38310 .

Testing Instructions

Create a Feed display module.
Enter https://www.joomla.org/announcements.feed?type=rss in Feed URL parameter
Enter Sidebar-right as position (using cassiopeia template)

Actual result BEFORE applying this Pull Request

Feed display module shows "Feed not found" error in all cases.

Expected result AFTER applying this Pull Request

Display Feed infos.

@conseilgouz
Copy link
Contributor Author

conseilgouz commented Jul 20, 2022

AppVeyor failed because $this->version has correct values for Atom and RSS files.

tests\Unit\Libraries\Cms\Feed\Parser\AtomParserTest.php file and tests\Unit\Libraries\Cms\Feed\Parser\RssParserTest.php seem to be wrong.

@richard67
Copy link
Member

AppVeyor failed because $this->version has correct values for Atom and RSS files.

tests\Unit\Libraries\Cms\Feed\Parser\AtomParserTest.php file and tests\Unit\Libraries\Cms\Feed\Parser\RssParserTest.php seem to be wrong.

@conseilgouz Then you should fix the tests, too. Let us know if you need some help or advise for that.

@richard67
Copy link
Member

P.S.: You can run the unit test locally on a git clone by running composer install (if not done yet) and then ./libraries/vendor/bin/phpunit --testsuite Unit from the Joomla folder.

@richard67
Copy link
Member

@conseilgouz The failing tests can be found here https://github.com/joomla/joomla-cms/blob/4.2-dev/tests/Unit/Libraries/Cms/Feed/Parser/AtomParserTest.php#L374-L387 and here https://github.com/joomla/joomla-cms/blob/4.2-dev/tests/Unit/Libraries/Cms/Feed/Parser/RssParserTest.php#L583-L601 .

But from reading the code, the tests seem to be correct regarding the checked versions.

Here the output from the test run in Appveyor:

There were 2 failures:
1) Joomla\Tests\Unit\Libraries\Cms\Feed\Parser\AtomParserTest::testInitialiseSetsOldVersion
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'0.3'
+'1.0'
C:\projects\joomla-cms\tests\Unit\Libraries\Cms\Feed\Parser\AtomParserTest.php:386
2) Joomla\Tests\Unit\Libraries\Cms\Feed\Parser\RssParserTest::testParseSetsVersion
Failed asserting that null matches expected '2.0'.
C:\projects\joomla-cms\tests\Unit\Libraries\Cms\Feed\Parser\RssParserTest.php:600
FAILURES!
Tests: 757, Assertions: 1190, Failures: 2, Skipped: 1.
Command exited with code 1

So it seems your PR is not right or changes something at the wrong place.

PR #38312  : update unit test
@conseilgouz
Copy link
Contributor Author

@richard67 : unit test files (RSS & ATOM) have been updated, so they match FeedFactory behaviour : go to root node and read it.

@conseilgouz
Copy link
Contributor Author

conseilgouz commented Jul 21, 2022

@richard67 : integration/drone/pr has a phpmin-system-postgress error : I'm afraid I don't have enough knowledge to fix this one....

@conseilgouz
Copy link
Contributor Author

After merging branch, postgress error disappeared...

@richard67
Copy link
Member

@conseilgouz Sometimes we have unrelated errors in system tests e.g. due to timeouts.

But besides this I am not convinced of your changes in the tests. The tests looked right to me before. I don’t have the time now for testing it myself, but if nobody else can reproduce the issue I have doubts on this PR.

@conseilgouz
Copy link
Contributor Author

conseilgouz commented Jul 21, 2022

@richard67 : about the changes, when initialise function is called in RssParser.php and AtomParser, stream (xmlreader) has read the root node : it's done in FeedFactory.php, function getFeed(), lines 68 and above.
In the unit test files, I just reproduced this behaviour.
Before my changes, initialise (in AtomParser.php and RssParser.php) was performing a moveToNextElement when reader was already on the feed or rss record (which should contain version info) : that was introduced by PR #38095

@conseilgouz
Copy link
Contributor Author

but if nobody else can reproduce the issue I have doubts on this PR.

That's a 4.2 RC1 issue. Let's hope somebody else will see this issue.

@conseilgouz
Copy link
Contributor Author

2 ways to fix #38310

  1. update FeedFactory.php, so it does not read xml file before calling initialise function
    or
  2. update RssParser & AtomParser so they assume actual xlm record is the root node

Current PR is following fix 2 idea.

@alikon
Copy link
Contributor

alikon commented Jul 25, 2022

i can replicate the issue like has been described

@conseilgouz
Copy link
Contributor Author

i can replicate the issue like has been described

It seems that just the two of us are interested in this issue.

@fontanil
Copy link

fontanil commented Aug 8, 2022

I have tested this item ✅ successfully on 6157800

Tested with success (4.2.0 rc2 dev)


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38312.

@conseilgouz
Copy link
Contributor Author

@alikon : one more human test to go.....

@YGomiero
Copy link

YGomiero commented Aug 9, 2022

I have tested this item ✅ successfully

Tested with success (4.2.0 rc2 dev)

@richard67
Copy link
Member

I have tested this item ✅ successfully

Tested with success (4.2.0 rc2 dev)

@YGomiero A comment with a green check mark is not sufficient for the test to count. You have to mark your test result in the issue tracker here https://issues.joomla.org/tracker/joomla-cms/38312 , use the blue "Test this" button at the top left corner, select the test result and finally submit. Could you do so? Thanks in advance.

@YGomiero
Copy link

YGomiero commented Aug 9, 2022

I have tested this item ✅ successfully on 6157800


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38312.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/38312.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Aug 9, 2022
@rdeutz rdeutz merged commit aa1f62a into joomla:4.2-dev Aug 19, 2022
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 19, 2022
@zero-24 zero-24 added this to the Joomla! 4.2.1 milestone Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants