GoogleCloudPlatform / appengine-maven-plugin

Automatically exported from code.google.com/p/appengine-maven-plugin
Apache License 2.0
19 stars 21 forks source link

All unit tests fail w/ appengine-api-1.0-sdk-1.9.49.jar #79

Closed chadbr closed 7 years ago

chadbr commented 7 years ago

Had an unpleasant surprise this evening when everyones build started to break on everyones machine.

Only difference from the rest of the day was downloading the new sdk:

:pcad:classes UP-TO-DATE :pcad:jar UP-TO-DATE :shared:compileJava Download https://repo1.maven.org/maven2/com/google/appengine/appengine-api-1.0-sdk/1.9.49/appengine-api-1.0-sdk-1.9.49.pom Download https://repo1.maven.org/maven2/com/google/appengine/appengine/1.9.49/appengine-1.9.49.pom Download https://repo1.maven.org/maven2/com/google/appengine/appengine-api-1.0-sdk/1.9.49/appengine-api-1.0-sdk-1.9.49.jar :shared:processResources UP-TO-DATE :shared:classes :shared:jar

Followed by lots of unit test failures:

com.foofoo.backend.api.UserControllerTest > getUsersShouldThrowForbiddenExceptionWhenNotAuthRealUser FAILED java.lang.Exception Caused by: java.lang.NoSuchFieldError at UserControllerTest.java:168

com.foofoo.backend.api.UserControllerTest > shouldGetPermissions FAILED java.lang.NoSuchFieldError at UserControllerTest.java:182

com.foofoo.backend.api.UserControllerTest > shouldNotAuthorizeTheWrongUser FAILED java.lang.NoSuchFieldError at UserControllerTest.java:67

com.foofoo.backend.api.UserControllerTest > getUserShouldThrowNotFound FAILED java.lang.Exception Caused by: java.lang.NoSuchFieldError at UserControllerTest.java:140

com.foofoo.backend.api.UserControllerTest > shouldCreateUser FAILED java.lang.NoSuchFieldError at UserControllerTest.java:87

The errors I get in IntelliJ are as follows: java.lang.NoSuchFieldError: usingExperimentalRuntime Unexpected exception, expected<com.google.api.server.spi.response.ForbiddenException> but was<java.lang.NoSuchFieldError>

image

So it looks like com.google.api.server.spi.response.ForbiddenException is missing or something?

ludoch commented 7 years ago

Maybe you still depend on a previous version artifact somewhere?

ludoch commented 7 years ago

Oh, and this is a Gradle build right? :-)

chadbr commented 7 years ago

yes, yes - gradle- downloading sdks as we speak

consultants...

chadbr commented 7 years ago

could I get google fiber run to my house as part of this issue?? :)

chadbr commented 7 years ago

ok - pushing everything to 1.9.49 fixed the issues - sorry for crying wolf!

Marcus-Trenton commented 7 years ago

I'm getting the same problem but am having trouble with the solution.

How do I push these version upgrades in gradle? Running gradle dependencies I see that every reference to appengine is 1.9.49. The tests work, but not the dev simulation itself.

ludoch commented 7 years ago

Which Gradle plugin are you using? Cloud SDK based or Classic Java SDK one (the original one, not based on Cloud SDK)?

On Tue, Jan 31, 2017 at 2:53 PM, Marcus-Trenton notifications@github.com wrote:

I'm getting the same problem but am having trouble with the solution.

How do I push these version upgrades in gradle? Running gradle dependencies I see that every reference to appengine is 1.9.49. The tests work, but not the dev simulation itself.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/appengine-maven-plugin/issues/79#issuecomment-276519918, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE4zT2QbT_xDYCgfEgtYewc5BH6zT9gks5rX7uGgaJpZM4LyLuK .

ludoch commented 7 years ago

The original one is at https://github.com/GoogleCloudPlatform/gradle-appengine-plugin and got and update yesterday...

chadbr commented 7 years ago

@Marcus-Trenton I'm not sure if it helps -- but We have a multi-level gradle build / solution.

In the root build.gradle we specify versions like this:

ext.appengineVersion = "1.9.49"
ext.gcloudVersion = "0.2.8"
ext.pubsubServicesVersion = "v1-rev11-1.22.0"
ext.objectifyVersion = "5.1.13"

in our "project level" build.gradle's (project/build.gradle) we specify the version of a dependency like this:

dependencies { compile project(":project")

compile "com.google.appengine:appengine-api-1.0-sdk:${appengineVersion}"

compile ("com.googlecode.objectify:objectify:${objectifyVersion}") {

so we set versions in one place and all the child projects use it...

hth, Chad

Marcus-Trenton commented 7 years ago

I'm using the non-deprecated one, app-gradle-plugin, https://github.com/GoogleCloudPlatform/app-gradle-plugin. Looking at the instructions at that URL, I do have the required lines:

buildscript {     // Configuration for building
  ext {
    // Variables that are used in both the buildscript and rest of the
    // build settings must be declared in an ext {} block in the buildscript
    // section, since buildscript is evaluated before everything else.

    artifactVersion = '1.0-SNAPSHOT'

    daggerVersion = '2.7'
    firebaseServerVersion = '3.0.1'
    guavaVersion = '19.0'
    jerseyVersion = '2.23.2'
    jodatimeVersion = '2.9.4'
    objectifyVersion = '5.1.13'
    swaggerVersion = '1.5.10'
    mustacheVersion = '0.8.18'

    generatedServerSrcDir = "${buildDir}/generated/"
    generatedClientApiSrcDir = generatedServerSrcDir + "clientApi/"
    generatedAdminApiSrcDir = generatedServerSrcDir + "adminApi/"
    generatedInfraApiSrcDir = generatedServerSrcDir + "infraApi/"
  }

  repositories {
    jcenter()     // Bintray's repository - a fast Maven Central mirror & more
    mavenCentral()
    mavenLocal()        // Needed for our custom version of gradle-swagger-plugin
  }
  dependencies {
    classpath "com.google.cloud.tools:appengine-gradle-plugin:+"      // latest App Engine Gradle tasks
    classpath "io.swagger:swagger-codegen:2.2.2-SNAPSHOT"
  }
}

plugins {
  id 'java'
  id 'war'

  id "net.ltgt.apt" version "0.5"
}

apply plugin: SwaggerPlugin
apply plugin: 'com.google.cloud.tools.appengine'
Marcus-Trenton commented 7 years ago

Thanks everyone for your input. It steered me towards the solution: rather than using the latest version, I just set everything to use appengine 1.9.48. Problem solved!