Closed RicardoMonteiroSimoes closed 1 year ago
I have some problems too! I think that needed move test configuration from embedded postgres to docker tests for mac M1
The issues seems to be that some older zonkyio (anything pre 2) cannot correctly get the naming of the binaries, but I might be wrong.
Hi @RicardoMonteiroSimoes.
The naming conventions of the binaries haven't changed since the beginning of the project, so that's not the problem. The system: Darwin, architecture: arm_64
parameters are also correct.
The most likely cause of the problem are missing binaries. The dependency containing ARM binaries is not included by default, it must be added explicitly. Specifying a BOM file is not enough, it is only for managing the same versions.
So are you sure you added this dependency correctly? What type of dependency management system are you using? Maven, Gradle or something else? Can you attach an example?
Here are more details about enabling additional architectures: https://github.com/zonkyio/embedded-postgres#additional-architectures
What issues have you faced during the upgrade that are not described in the upgrade guide? https://github.com/zonkyio/embedded-database-spring-test/wiki/Embedded-Database-2.0-Release-Notes#upgrading-from-embedded-database-1x
The most likely cause of the problem are missing binaries. The dependency containing ARM binaries is not included by default, it must be added explicitly. Specifying a BOM file is not enough, it is only for managing the same versions.
Ah, that was the mistake. Was under the impression that the BOM
included all Binaries, which is only the case for AMD64. After adding the ARM
one the error went away.
Right now, even after clearing the var/folders/...
temporary data, it fails to initialize the database.
java.lang.IllegalStateException: Process [/var/folders/_v/wp04d1994sd2tvqr3w14k5t40000gp/T/embedded-pg/PG-66d16f7b5fc12f5fc27ced9cf1b4c8e8/bin/initdb, -A, trust, -U, postgres, -D, /var/folders/_v/wp04d1994sd2tvqr3w14k5t40000gp/T/epg8352490524182623772, -E, UTF-8] failed
at io.zonky.test.db.postgres.embedded.EmbeddedPostgres.system(EmbeddedPostgres.java:632)
Not sure what this could be about
What issues have you faced during the upgrade that are not described in the upgrade guide?
Up until now I extended the DefaultFlywayDataSourceContext
, which of course is gone with v2+. It's replacement isn't quite clear to me - there are mentions of classes being moved/refactored, but that's about it.
Right now, even after clearing the var/folders/... temporary data, it fails to initialize the database.
Could you please attach the log file for further investigation?
Up until now I extended the DefaultFlywayDataSourceContext, which of course is gone with v2+. It's replacement isn't quite clear to me - there are mentions of classes being moved/refactored, but that's about it.
This is a low level internal API, so I didn't expect that anyone would need to extend this class. But if you think it might be useful, feel free to open a separate issue for that.
Or just join this one #216
Or just join this one #216
Yup, that one is basically the same.
Hello,
First of all, thank you for having these open source solutions. They're excellent and quite helpful. I am trying to get my current project to work on a Mac M1, and was able to solve most issues. The one I'm currently facing involves
embedded-database-spring-test
.The current version that is being used is
io.zonky.test:embedded-database-spring-test:1.6.3
, and we would like to upgrade in the near future, but2.x
introduces breaking changes that we'd have to solve (and are somewhat absent from the upgrade guide?). Anyway, as I am sitting on arm64 platform, I upgradedio.zonky.test.postgres:embedded-postgres-binaries-bom
to15:0.0
, which according to the gradle log, and my console output, downloads all the possible binaries:Now, whenever I start running my tests, they fail. To be precise, they fail using an
initializationError
, which is cause by it not finding the correct binary:I assume it might be because it's looking for
darwin-arm64
but it can only finddarwin-arm64v8
, but can't confirm it_Any way, this of course leads to it failing and therefor not passing. What I can say is that on a linux OS machine, the project can test without any issue using
io.zonky.test.postgres:embedded-postgres-binaries-bom:11.9.0
.So I assumed that this might be an issue involving macOS - according to my research, gradle cached files are saved on the same spot as they would be under linux, so that shouldn't be the issue. (I don't even know where it tries to find the binaries, so theres that).