agomezmoron / docker-appium

Docker image to run your appium test against a defined Android emulador and SDK
MIT License
13 stars 6 forks source link

There is no POM in this directory (/src) & [FATAL] Non-readable POM problem #1

Open estefafdez opened 7 years ago

estefafdez commented 7 years ago

Hello,

We follow all the instructions described into this project. We create an AppiumCore project with all the information necessary to run test using Appium. The test contained on the project run in our local environment (run the test on the IDE and by executing mvn test on the command line).

The pom.xml file is included on the /src directory as requested.

If we run this docker-appium along with our project, we get the following errors:

First error: there is no POM in this directory (/src):

[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/src). Please verify you invoked Maven from the correct directory.

And then, if we create a new pom.xml file with the same content, we get the following error:

CREATING AND LAUNCHING EMULATOR...

DONE.

STARTING APPIUM COMMAND...

Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_141, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "4.10.0-37-generic", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /root/.m2/settings.xml
[DEBUG] Using local repository at /root/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /root/.m2/repository
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM /opt/AppiumCore/src/pom.xml: /opt/AppiumCore/src/pom.xml (No such file or directory) @

       at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:363)
       at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:636)
       at org.apache.maven.DefaultMaven.getProjectsForMavenReactor(DefaultMaven.java:585)
       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:234)
       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
       at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
       at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
       at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:498)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
       at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)

Any idea what could we do to resolve the problem?

Thank you.

estefafdez commented 7 years ago

Docker Version: 17.09.0-ce Local OS: ubuntu 16.04

agomezmoron commented 7 years ago

Hi! It seems an error when you run the docker image. Are you linking properly the /src folder to the source one you have in your env?

Cheers!

estefafdez commented 7 years ago

Hello again,

First, we do:

docker build --build-arg JAVA_VERSION=8 --build-arg ANDROID_SDK_VERSION=23 --build-arg VNC_PASSWD=1234 -t agomezmoron/docker-appium . && docker rmi -f $(docker images -f "dangling=true" -q) &> **/dev/null**

And we get:

 Successfully built bd3fe676a099
Successfully tagged agomezmoron/docker-appium:latest

Appium Project File Structure: androidcorefolder

And then, to execute the test, we do:

docker run --privileged -v /opt/AppiumCore:/src -v /opt/AppiumCore:/src/target -e HOST_UID=$(id -u) -e HOST_GID=$(id -g) -e DOCKER_TESTS_COMMAND="mvn test" --rm -t -i -p 5900:5900 agomezmoron/docker-appium

We get the following console output: salidamaven

Any idea of what the problem could be? Thanks!

agomezmoron commented 7 years ago

It seems a maven issue. Could you please put the result of ls -l /opt/AppiumCore?

Also instead of running -e DOCKER_TESTS_COMMAND="mvn test" try to run -e DOCKER_TESTS_COMMAND="mvn test -X" to see a full stacktrace.

Thanks!

estefafdez commented 7 years ago

Hello again:

ls -la /opt/AppiumCore 1

Docker run with mvn test -X: 2

agomezmoron commented 6 years ago

Hi @estefafdez,

After reviewing this it seems the Dockerfile has a typo. If you add there an execution like:

mkdir /src

rebuilds the image and run it back, does it work? If yes, please create a PR with that change.

Thanks!