-
-
Notifications
You must be signed in to change notification settings - Fork 204
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
chore(#109): Run test suite from the apdex test automation branch #9114
Conversation
I have asked for help on the dev channel for the failing CI builds |
5eb19da
to
4382d09
Compare
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.
@ralfudx, the CI it's throwing an error that says:
npm ERR!
npm ci
can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync.
In this PR, you have made changes in package.json only, so it's not in sync with the package-lock.json.
-
You need to run:
npm install @wdio/appium-service --save-dev
npm install appium-uiautomator2-driver --save-dev
npm install ts-node --save-dev
-
Then, commit and push those changes of package-lock.json. It should only contain changes from those 3 new dependencies.
-
Once you have that, then remove the following from apdex-score/package.json because we already have those dependencies in the main package.json of CHT:
@wdio/allure-reporter
@wdio/appium-service
@wdio/cli
@wdio/local-runner
@wdio/mocha-framework
@wdio/spec-reporter
allure-commandline
faker we already have `@faker-js/faker`
ts-node
typescript
-
The
apdex-score
folder should also have a package-lock.js file. To get it properly generated, install each dependencies manually. -
I have these questions:
- Do we really really need "moment-timezone"?
- Is it possible to keep "appium-uiautomator2-driver" in apdex-score/package.json ?
@latin-panda thanks for the comment and requested changes - I had previously done these steps and I just did them again however, the build is still failing with the error I reported in the dev channel and I'm not sure why this is still happening but I noticed that even when i install the dependencies one by one with the commands you suggested above it seems the To answer your questions:
I have these questions though:
|
Maybe it was nice to keep it in apdex-score/package.json because it's only used there. But if it's not possible, then it's okay in the main package.json
Good question. If the file ends up without dependencies to install and no scripts defined, I think it makes sense to remove it. 🤔 |
@latin-panda @lorerod @Benmuiruri can you kindly help review this? I've only made changes to the package.json file so it should be quick i guess? 😃 |
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.
@ralfudx I'm getting this error - I tried with sudo and still not working
Are you getting the same error?
Also if we don't need the scripts
in the apdex-score/package.json, I think you can delete the file in this PR.
"scripts": {
"test": "npx wdio wdio.conf.js",
"report": "npx allure generate allure-results --clean && npx allure open",
"apdex-test": "wdio run ./wdio.conf.js"
},
Yes @latin-panda this is because the path to the apk in the |
@Benmuiruri and @latin-panda I'd appreciate a final review on this so it can be merged this week |
@ralfudx I pulled the latest from the branch, but it is still not working after a fresh install of the repo. It seems some files are using that How are you running these tests in your local environment? |
@latin-panda I pulled the latest from |
@ralfudx if you remove the node_modules from the root folder and apdex-score folder, and then |
@latin-panda yes I get the same error after doing |
@ralfudx, but here, you mentioned that we don't need
It is better to remove or comment the import of this dependency in those files instead of installing the dependency into CHT. We try to add just the necessary to CHT to keep it slim |
@latin-panda after having a deeper look I noticed we are still using it in |
I see thanks @ralfudx; I took a deeper look this morning. Those values are for filling out the forms, right? They will need to be included in the form's configuration of the settings file before running the test suite every time. So, no dynamic dates are required. However, if we still need date conversion in an edge case, the existing e2e tests use the regular Therefore, it is better not to add |
@latin-panda i have removed |
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.
@ralfudx I've tested the branch and it's running the test properly with the settings file (see video)
Screen.Recording.2024-05-21.at.12.47.16.PM.mp4
However the moment-timezone
wasn't properly uninstalled and the package-lock.json still has the dependency defined. (See that package-lock has 57k lines, it should be less than 40k)
Run npm uninstall moment-timezone
in the root folder, that should update the package-lock
@latin-panda thanks for the observation, I have done this and even after running |
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.
@ralfudx It's better to not fix the package-lock file because it has some special logic that is autogenerated and that can cause unexpected behaviors in the apps.
When the issue you described happens, it's better to install it (npm install moment-timezone --save-dev
) and then uninstall it (npm uninstall moment-timezone --save-dev
), npm will handle the package-lock and void problems.
@Benmuiruri and @lorerod if you'd like to provide a quick review as well, I'd appreciate that before we merge this to the |
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 @ralfudx could you update the PR description with the steps for reviewing it ?
@Benmuiruri I have updated the description. Kindly let me know if something there is not clear |
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.
LGTM! After making adjustments to Jenni's sample script I was able to run the tests successfully
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.
Just a minor suggestion.
Thanks @ralfudx
// async extractCurrentDate(days) { | ||
// const dateTimeString = await driver.getDeviceTime(); | ||
// let dateTime = moment(dateTimeString); | ||
// dateTime = moment(dateTime).add(days, 'days'); | ||
|
||
// const year = dateTime.format('YY'); | ||
// const month = dateTime.format('MM'); | ||
// const day = dateTime.format('DD'); | ||
// const hour = dateTime.format('HH'); | ||
// const minute = dateTime.format('mm'); | ||
|
||
// return {year, month, day, hour, minute}; | ||
// } | ||
|
||
// async updateCurrentDate (days) { | ||
// const extractCurrentDate = await this.extractCurrentDate(days); | ||
// console.log('TIME::: Year:', extractCurrentDate.year); | ||
// console.log('TIME::: Month:', extractCurrentDate.month); | ||
// console.log('TIME::: Day:', extractCurrentDate.day); | ||
// console.log('TIME::: Hour:', extractCurrentDate.hour); | ||
// console.log('TIME::: Minute:', extractCurrentDate.minute); | ||
// console.log('TIME::: Extracted Components:', extractCurrentDate); | ||
// const adbDateFormat = `${extractCurrentDate.month}${extractCurrentDate.day}${extractCurrentDate.hour} | ||
// ${extractCurrentDate.minute}${extractCurrentDate.year}`; | ||
// execSync('adb shell su root date ' + adbDateFormat, { stdio: 'inherit' }); | ||
// browser.pause(10000); | ||
// } | ||
|
||
// async getLmpDate () { | ||
// const extractLmpDate = await this.extractCurrentDate(-62); | ||
// const lmpDate = `20${extractLmpDate.year}-${extractLmpDate.month}-${extractLmpDate.day}`; | ||
// return lmpDate; | ||
// } | ||
|
||
// async getFollowUpDate () { | ||
// const extractNextDate = await this.extractCurrentDate(1); | ||
// const followUpDate = `20${extractNextDate.year}-${extractNextDate.month}-${extractNextDate.day}`; | ||
// return followUpDate; | ||
// } | ||
|
||
// async getVHTVisitDate () { | ||
// const extractPreviousDate = await this.extractCurrentDate(-1); | ||
// const visitDate = `20${extractPreviousDate.year}-${extractPreviousDate.month}-${extractPreviousDate.day}`; | ||
// return visitDate; | ||
// } |
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 delete the commented lines?
Description
#109
To review this you can do the following:
npm ci
from the repository's root directorynpm run apdex-test
Code review checklist
Compose URLs
If Build CI hasn't passed, these may 404:
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.