Atom.packages.resolvePackagePath('package-name')` undefined in travis and appveyor but not locally


#1

I’m using the package’s own folder as file area for some caching stuff and I wrote an integration tests that uses it. atom.packages.resolvePackagePath('package-name') however returns undefined on travis and appveyor. It works locally however. Shouldn’t this work?


#2

It probably should, though I suppose that depends on why exactly it isn’t working.


#3

Are you calling that function with your testing package name or some other third party package?


#4

@jerone My own package name.


#5

It was a race condition. I used a require clause at the top of my test that made the resolvePackagePath be called at load. This somehow worked when running locally with:

apm test or atom --dev --test spec-integration but failed on all ci environments. This change made it work there too:

PR with links to CI: https://github.com/ensime/ensime-atom/pull/194

I guess the weird thing is why it worked locally. Is atom + plugins already loaded before tests run? Most package tests seem to wait for package activation…?