-
Notifications
You must be signed in to change notification settings - Fork 276
Update location of Moodle app behat tests steps #263
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
Conversation
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.
Hi, thanks for the contribution!
While "grepping" for uses I've seen that tests/app-setup.sh
also have a few uses of the old moodlemobileapp
repo.
Just guessing if we should also change them to the new moodleappbehat
... pinging @NoelDeMartin .
Ciao :-)
Thanks for the ping @stronk7, yes I see there are a couple more places where this should be updated. If you want, we can merge this one and I'll open a new PR with anything else that needs updating. |
No worries, I will go and look at fixing them up. |
@NoelDeMartin It looks like the tests are failing because the moodleappbehat repository does not have a branch for each app version in the same way the old one did. i.e. no v3.9.0 branch Should they be there? |
Thanks for fixing the remaining case in README, @NeillM . I'll wait for @NoelDeMartin about, maybe, leaving the tests for separate issue. I really was expecting, pretty much like Neill I imagine, that the replacement was all we needed. But it seems that it's not only that so, yes, please Noel, confirm if we should delegate this to another issue and keep using the old repo for CIs in the mean time here. Ciao :-) |
Well, in fact... the README continue being wrong because there, the |
I don't see --branch "v$appversion" in the README (or is the lack of reference there the problem?) If the new way of doing things does not require the separate branches I will make sure that the main branch is always the one pulled done in the tests. |
Sorry my fault, I was reading that in the So just let's see what Noel opines about leaving the tests unmodified here (and delegate them to another issue), or if different branches (main, ci, latest...) are needed and that needs to also be documented here. Ciao :-) PS. Again, sorry for the confusion! |
Sorry for all the confusion about this 🙈️. I'll explain how we got here and the current status of the plugins, hopefully to make things clear. If you just care about what to do in this PR, go to the TLDR at the end. This new plugin The 2 goals are:
(The old plugin Before the new plugin existed, both things were done in the repository of the plugin. But we decided to move these to the app repository, to improve maintainability in the long term. Because of that, the new plugin is now auto-generated from files in the app repository so it's not modified directly. If you want to modify anything in this plugin, you'd do it in the app repo. For the first goal (providing behat steps), we have the At the same time, though, the app should work with all the supported versions of the LMS. But now instead of doing that with branches, we have everything in a single branch and discriminate versions using tags like For the second goal (providing acceptance tests), we have the In case you're curious, these are generated with the build-behat-plugin.js script and you can use the TLDR: Having said all that, I think we should just use Again, if this all still sounds too confusing, feel free to just update the documentation and I'll look into it after merging this PR. |
Thanks for the explanation Noel. Based on my interpretation of what Noel said I have changed the app tests so that the app-development suite will use the main branch and the other ones will use the latest branch. I am not sure that I agree that the feature file should be in this repository though, since the steps in the moodleappbehat plugin may change over time breaking it, is seems that it would be better for the feature to be in the moodleappbehat plugin itself. I have not done it yet, but I do wonder if it is maybe worth changing the app tests to be for just the latest and develop versions of the docker app and the equivalent for the source code versions (since that way in theory the tests are always running against supported versions) which means that they are less likely to need updating in the future. I'm saying this based on the develop versions being reasonably stable test wise like the Moodle master branch is. |
I also realised I had not updated a link to the App acceptance testing documentation. |
Well, that's true, but the steps should be fairly stable because we try not to break them since rewriting those would require a lot more work. For example, whilst all of this has moved from one plugin to another, the steps have remained the same. My idea with adding a By the way, tests are passing now but that's because no tests are being run (given that none are included in the
Yeah I think that would make sense. The latest version of the app should be fairly stable, at least when it comes to testing basic things like entering the app. We are running behat tests in the CI pipeline in Github in all PRs, so they shouldn't break often. Also, the ionic3 versions of the app have been unsupported for a long time, and even their equivalent in the LMS are about to reach end of life. So I'd also vouch for dropping that. |
That seems fair, I have added a feature file that just starts the app. It is probably worth checking that you agree with how I have changed the app test grid. I did not get rid of the runtime parameter as I imagine there will come a time when the live and development versions of the app will differ in that again. I only test the app-development suite against the latest version of Moodle on the basis that it should not really be affected in any way that is different to the docker version. Thinking about it more since I made my latest commits I wonder if the app tests could be further reduced by only testing against the lowest supported PHP versions for older versions of Moodle, while using lowest and highest PHP versions only for the current Moodle version (since I think the PHP versions are probably not affecting the app setup too much) |
It does look like my latest changes broke something in the app tests. |
It looks like my failures came around because I did not realise grep errors if there was no match found. I think it should be fixed now. |
To be honest, So it should work with the "ionic5" runtime once we upgrade beyond ionic5. But it's ok if you want to leave it as is right now, I'll clean it up when we actually do the upgrade. |
The tests now simply check that the app can be started for both the lastest and development versions of the app work properly. The Ionic3 versions are now well out of support. It is likely most users would only be using these two versions of the app.
It looks like the latest branch of the app source code is failing during it's npm run with: `<--- JS stacktrace ---> FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory The one using the main branch is passing though. |
It looks like it might be a random fail, since the same tests have passed in github actions for my repository |
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.
Thanks, I think it looks good now :). I don't see anything wrong, so the failures are probably random as @NeillM mentioned.
Great work, @NeillM and @NoelDeMartin ! I've relaunched the 2 failed jobs @ GHA, let's see if they end green. I'll be performing the final review to this along the day. My understanding is that both you are happy with the current proposal, correct? (+1/-1 this comment, please). Ciao :-) |
Uhm... needed a couple of reruns to get them passing, hope it's some interim problem out there... anyway we are green now. As said... I'll look to this soon, ttyl! Ciao :-) |
Sold, thanks! |
Thanks both. |
BTW, I've just seen both the moodlehq and my clone GHA tests failing, like it was happening here. And both with 402_STABLE. I'm not going to re-run them, so we have the links:
They seem to happen more or less consistently in the Ciao :-) |
I'm hoping that Noel might have some ideas why it is failing. It is odd that it seems to be failing consistently on the latest branch of the app code (my understanding is that is the live version of the app) and not on the main one (and this is the in development version of the app). |
I imagine as a real backstop I could probably the highest version number that was being tested before my change instead of the latest branch |
We recently updated some dependencies in the main branch, so that may be one of the reasons for the difference. But other than that, I have no idea why it's failing. The only idea that comes to mind is that we're using Seeing that it has something to do with running out of memory, and the fact that it works sometimes, I'm not sure how we could fix it :(. |
It looks as though it was also working fine of the v4.0.0 branch before these changes, I guess that was a couple of versions behind latest. |
The Is there any reason for that? Are we sure that the globally installed npm (v7) is getting precedence over the v6 coming in the image? Maybe it's needed to use 'npx npm' (note I don't know!). In fact the workflow execution clearly says that the lockfile is old, created with old version of npm.... then... why are we forcing the use of newer npm (v7) ? Just sharing thoughts, heh... do you also install npm v7 elsewhere, or just use the "bundled" (together with node) one? It's an strange upgrade, I would say (sure that for a reason, but... better ask). Ciao :-) |
You're right, I totally forgot about that! We were using npm 7 by mistake in the past, but we updated the app to work with npm 6 in this PR: moodlehq/moodleapp#3301 (about a year ago). So that can probably be removed, not sure if it will fix the flaky out-of memory thing though. |
^^^ Heh, it seems that it has fixed the memory problem, now the FOUR "app-development" jobs are failing with different error (that I'm far away from understanding). |
I'm guessing that is this error `Creating Behat configuration ...!!! Coding error detected, it must be fixed by a programmer: Unable to load app version from http://moodleapp:8100/assets/env.json !!!
Or perhaps this one: `> [email protected] build /app/node_modules/keytar
Package libsecret-1 was not found in the pkg-config search path. npm ERR! A complete log of this run can be found in: |
Ping? |
Hey, sorry I saw the errors but I don't know why they are happening, so I don't have much to add :/. The only thing I can say is that the error saying I'll see if I can reproduce this myself, but off the top of my head I don't know what's going wrong. |
On Thursday before heading for a long weekend I did have a go at at making an ugly workaround (i.e. running the highest version of the app tested (v4.0.0) by the old set of tests when the latest app branch is called) but that fails on app start up. https://github.com/NeillM/moodle-docker/tree/workaround-failures The updated master branch did not fail for me when I pushed that up to my repository (I don't think it has ever failed against my github actions for some reason) |
Thanks @NoelDeMartin, looking to #267 now, see you there! |
I wanted to update the docs for the current locations of the Moodle app behat steps.