yavin-dev / framework

A framework for rapidly building production quality analytics applications
https://yavin.dev
MIT License
84 stars 35 forks source link

Yavin Demo App Test are not passing #1726

Open QubitPi opened 1 year ago

QubitPi commented 1 year ago

Describe the bug

We were trying to run test on a Yavin app but see tests were failing.

To Reproduce

  1. git clone git@github.com:yavin-dev/app.git
  2. cd app
  3. ./gradlew build

Expected behavior

All tests should pass

Screenshots

StaticAssetServingTest > graphiql_landing_page_test() PASSED

StaticAssetServingTest > ui_route_test() FAILED
    java.lang.NullPointerException at StaticAssetServingTest.kt:48

StaticAssetServingTest > api_landing_page_test() PASSED

StaticAssetServingTest > swagger_landing_page_test() PASSED

StaticAssetServingTest > landing_page_test() FAILED
    java.lang.NullPointerException at StaticAssetServingTest.kt:25

RoleTest > createDateTest() PASSED

RoleTest > roleEndpointTest() PASSED

DashboardTest > dashboard() PASSED

DashboardTest > wrongUser() PASSED

DashboardTest > permissions() PASSED

DashboardTest > dashboardWithWidgets() PASSED

DashboardTest > globalFilters() PASSED

DashboardWidgetTest > dashboardWidget() PASSED

DashboardWidgetTest > widgetSetAuthor() PASSED

DashboardWidgetTest > widgetUserPermission() PASSED

DemoDataSourceTest > simple_netflix_table_test() PASSED

BasicTest > basic_server_hello() PASSED

AsyncQueryTest > testAsyncQueryPermissions() PASSED

UserTest > userEndpointTest() PASSED

UserTest > createDateTest() PASSED

UserTest > userPermissions() PASSED

UserTest > reverseRelationships() PASSED

UserTest > favoriteReports() PASSED

UserTest > roles() PASSED

UserTest > editingDashboards() PASSED

UserTest > securityTest() PASSED

UserTest > favoriteDashboards() PASSED

CorsFilterTest > it can return cors headers() PASSED

CorsFilterTest > it rejects bad request methods() PASSED

ReportTest > userPermissions() PASSED

ReportTest > report() PASSED

ReportTest > wrongUser() PASSED

ReportTest > differentAuthorPermissions() PASSED

ReportTest > createDate() PASSED

ReportTest > testHaving() PASSED

ReportTest > reportSort() PASSED

RequestV2Test > dashboardsWithRequestV2() PASSED

RequestV2Test > reportWithRequestV2() PASSED

RequestV2Test > testHaving() PASSED

ServerGeneratedConfigTest > server_generated_config() PASSED

40 tests completed, 2 failed

> Task :ws:test FAILED

FAILURE: Build failed with an exception.

Desktop (please complete the following information):

Additional context

N/A

kevinhinterlong commented 1 year ago

Could you tell us which version of Java you are using? I think our readme might be outdated and you may see those errors with java 8, but I just tried to reproduce this using java 11 and the tests passed

$ javac -version
javac 11.0.11
QubitPi commented 1 year ago

Hi @kevinhinterlong . Thanks for the prompt response. Our environments have Java 11 as well

javac -version
javac 11.0.16.1

One of the failed tests seems to be complaining about StaticAssetServingTest.kt:25

StaticAssetServingTest > landing_page_test() FAILED
    java.lang.NullPointerException at StaticAssetServingTest.kt:25

On that line, it is trying to load a file in resources/ui directory, which we didn't see on master branch

kevinhinterlong commented 1 year ago

Hmm, it sounds like it's not building the ui subproject and copying the output over correctly. These are the files that it should build and copy over

# in the root 'app' dir
$ ls ui/build/resources/main/META-INF/resources/ui/
assets     fonts      img        index.html robots.txt testem.js  tests

You could also try running ./gradlew build -p ui directly to see if any errors occurred during the build

QubitPi commented 9 months ago

Thank you @kevinhinterlong for investigating! I'll definitely try it later today

(Sorry for the very late reply. :) )