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

Integration tests failing with 5.0.1 and 5.0.2 (5.0.0 is working) #640

Open
Sickboy78 opened this issue Jan 22, 2025 · 11 comments
Open

Integration tests failing with 5.0.1 and 5.0.2 (5.0.0 is working) #640

Sickboy78 opened this issue Jan 22, 2025 · 11 comments

Comments

@Sickboy78
Copy link

Hi!

my integration tests will fail, when I upgrade @iobroker/testing to 5.0.1 or 5.0.2 with:
"before all" hook: prepareTests in "Adapter integration tests": TypeError: (0 , objects_1.entries) is not a function or its return value is not iterable at AdapterSetup.installAdapterInTestDir (node_modules\@iobroker\testing\build\tests\integration\lib\adapterSetup.js:103:60) at async Context.prepareTests (node_modules\@iobroker\testing\build\tests\integration\index.js:73:9)
see https://github.com/Sickboy78/ioBroker.sureflap/actions/runs/12915451728/job/36017361053?pr=156
They are working fine with 5.0.0.
Any help would be appreciated!

Best Regards
Sebastian

@mcm1957
Copy link
Contributor

mcm1957 commented Jan 22, 2025

same here: https://github.com/simatec/ioBroker.solax/actions/runs/12915319734/job/36016931916

Releases 5.0.1 and 5.0.2 are broken . Do not update to this versions (at least for now).

@GermanBluefox
Copy link
Contributor

Please test 5.0.3

@Sickboy78
Copy link
Author

Unfortunately the error just changed with 5.0.3:
"before all" hook: prepareTests in "Adapter integration tests": TypeError: this._statesClient.delStateAsync is not a function at DBConnection.delState (node_modules\@iobroker\testing\build\tests\integration\lib\dbConnection.js:92:39) at AdapterSetup.deleteOldInstances (node_modules\@iobroker\testing\build\tests\integration\lib\adapterSetup.js:149:32) at async Context.prepareTests (node_modules\@iobroker\testing\build\tests\integration\index.js:78:9)

@hombach
Copy link

hombach commented Jan 28, 2025

same - 5.0.3 also not working

@mcm1957
Copy link
Contributor

mcm1957 commented Jan 29, 2025

@Sickboy78 @hombach
Interesting. Please provide a link to the runs.
5.0.3 is working at least in some setups.

@mcm1957
Copy link
Contributor

mcm1957 commented Jan 29, 2025

@Sickboy78
You are not using standard workflow and not using components ioBroker/testing-action-check and ioBroker/testing-action-adapter. Maybe you private setup is no longer fully compatible with iobroker/testing.

Please consider using standard test environment. An up to date test-and-release workflow can be found at ioroker.iobroker.examples repo.

At least please check wether standard workflow works or fail too so that we get more information about the problem and its reason.

@Sickboy78
Copy link
Author

Sickboy78 commented Jan 29, 2025

@mcm1957
I updated the github test-and-release workflow to the latest version from the examples repo and it works now with 5.0.3 in github:
https://github.com/Sickboy78/ioBroker.sureflap/actions/runs/13039861884
Strange enough it's still not working locally.
When started with npm run test:integration it still gives this error:
"before all" hook: prepareTests in "Adapter integration tests": TypeError: this._statesClient.delStateAsync is not a function at DBConnection.delState (node_modules\@iobroker\testing\build\tests\integration\lib\dbConnection.js:92:39) at AdapterSetup.deleteOldInstances (node_modules\@iobroker\testing\build\tests\integration\lib\adapterSetup.js:149:32) at async Context.prepareTests (node_modules\@iobroker\testing\build\tests\integration\index.js:78:9)
Tested with Node versions 20.12.2, 20.18.2 and 22.13.1.
It's working with 5.0.0 though.
Any idea what could be the problem locally?

@mcm1957
Copy link
Contributor

mcm1957 commented Jan 29, 2025

just to be sure
you executed a npm i locally to update?

maybe you could delete the node_modules tree an reload it using npm i

for tests you coul pull the working github versionninto a new local directory and check if it works.

Otherwise i do not have a real idea. ev check uf you installed something globally which causeus a conflict.

@mcm1957
Copy link
Contributor

mcm1957 commented Jan 29, 2025

hmmm...
could check how the action packages start the test. maybe theres a difference.

I m on mobile only. Maybe i can have look tomorrow

And there coulb be a differnce at js-controller. Githubbuses nightly while you use latest i guess. Problem does not indicate this ... but one could check.

@hombach
Copy link

hombach commented Jan 31, 2025

By deleting "type-checking: true" in test-and-release workflow it's working in GITHUB - but locally I still have a type-checking and there I get:

Adapter integration tests
       "before all" hook: prepareTests in "Adapter integration tests":
     TypeError: this._statesClient.delStateAsync is not a function
      at DBConnection.delState (node_modules\@iobroker\testing\build\tests\integration\lib\dbConnection.js:92:39)
      at AdapterSetup.deleteOldInstances (node_modules\@iobroker\testing\build\tests\integration\lib\adapterSetup.js:149:32)
      at async Context.prepareTests (node_modules\@iobroker\testing\build\tests\integration\index.js:78:9)

@Sickboy78
Copy link
Author

@mcm1957
Yes, I deleted node_modules before running npm install.
I also tried npm cache clean --force and deleting %LocalAppData%/npm-cache manually to no avail.
I cloned my adapter into a differnet folder, didn't work either.
And now it gets even stranger.
I installed node on a clean system where no node was installed before and checked out my adapter.
Run npm install and npm run test:integration.
And it worked.
Exactly once.
I couldnt believe it, so I just run npm run test:integration again (without changing anything or even executing another command).
And it failed. Same error as above.
I have not been able to get it to work again since then.
I cleared all the caches and deleted node_modules, even uninstalled and reinstalled node and npm.
But that would probably explain, why it is working on github, because the tests are always run on a clean instance.
I'm not a nodejs pro, so any idea where the wrong bit hides, even after a node uninstall and deleting all the caches?

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

4 participants