8000 Article creation test fails · Issue #1148 · foodcoops/foodsoft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Article creation test fails #1148

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
twothreenine opened this issue Mar 27, 2025 · 2 comments
Open

Article creation test fails #1148

twothreenine opened this issue Mar 27, 2025 · 2 comments

Comments

@twothreenine
Copy link
Contributor
twothreenine commented Mar 27, 2025
  1) ArticlesController :index creating articles can create a new article
     Failure/Error: expect(page).to have_content(article_version.name)
       expected to find text "porro accusamus #2" in "foodsoft\nBlaine \nFC Minimal\nDashboard\nFoodcoop \nWiki \nOrders \nArticles \nChange supplier \nArticles from Fritsch, Botsford and Adams (1)\nMigrate old article units... New article Edit all Upload articles Download articles\n\tName\t\tCategory\tUnit\tNote\tU.Q.\tPrice (net)\tVAT\tDeposit\t\n\timpedit vel eius consequatur #1\t\tcp5nfll #2\tkA\t\tkA\t€ 6.53\t6%\t\tEdit Copy Delete\n \nSelect action ...\nDelete article\nMake articles unavailable\nMake articles available\nFoodsoft v4.9.1\nFC Minimal\n×\nAdd new article\nIs article available?\n* Name\nDelivery unit\nCustom\nPackage\nPiece\nPackage\nUnit ratios\nAdd ratio\nMinimum order quantity\n Package\ncan be ordered per\n×\nPackage\n* Price (net)\n€  \nper\nPackage\n* VAT\n %\n* Deposit\n€  \nFoodCoop price\n€ 27.10 per Package\nNote\n* Category\nyr #1\ncp5nfll #2\nOrigin\nManufacturer\nOrder number\nClose"
     # ./spec/integration/articles_spec.rb:50:in `block (4 levels) in <top (required)>'

Finished in 7.61 seconds (files took 3.82 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/integration/articles_spec.rb:36 # ArticlesController :index creating articles can create a new article

It's a bit confusing to me that sometimes (every second time?), the test still fails, but the checks pass, like they did in #1082 after I amended my commit the last time.
https://github.com/foodcoops/foodsoft/actions/runs/14096355453/job/39484356726?pr=1082#step:9:325

but also in #1143:
https://github.com/foodcoops/foodsoft/actions/runs/14007877933/job/39224023648?pr=1143#step:9:325

@lentschi
Copy link
Contributor

In the specific case of what you've posted it might have to do with #1073.

But the real issue here has already existed 11 years ago when @wvengen has put a workaround in place:
8ac7cbf

<- That is why - while the test you mentioned failed the first time - the pipeline still succeeded as it passed the second time.
(rspec-rerun tries the test one more time by default).

While wvengen was right back then (integration tests indeed can be brittle) - I think we should try and eventually remove his workaround (i.e. uninstall rspec-rerun) to make things more reproducible for developers.

This can however be arduous as the current integration tests are hard to debug! So I wonder if we shouldn't postpone this task until we have agreed upon a strategy for a frontend makeover - also see my comment here: #1140 (comment) (The part about a e2e/integration tests for a PWA)

@RayOei
Copy link
Contributor
RayOei commented Mar 31, 2025

Yes. This need some discussion. Integration tests should not be brittle as that more or less means they are not effectively proving what you want to have verified.
BTW: for me integration means checking how parts of the puzzle interact (which may need some mocking here or there) and E2E 5A97 the full interaction as a user or endpoint would use the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0