Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests fail due to unavailable Drupal server #14

Open
tomkatsu opened this issue Sep 2, 2020 · 2 comments
Open

Unit tests fail due to unavailable Drupal server #14

tomkatsu opened this issue Sep 2, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@tomkatsu
Copy link
Contributor

tomkatsu commented Sep 2, 2020

Unit tests are now failing because the URLs are hard-coded in the test code. Unit tests should test without dependencies on outside servers. Integration tests can still be present, but should not block a basic gradle build like unit tests do. Integration tests should have configurable settings for servers to interact with.

@tomkatsu tomkatsu added the bug Something isn't working label Sep 3, 2020
@bogdanv96
Copy link
Contributor

For our unit tests, we are using mock data so this should not happen. We have some hardcoded URL but no external services are called.

I can run the

./gradlew clean build assemblePlugin

command even if the URLs are not available.

Please let me know if this bug needs more investigation or changes.

@tomkatsu
Copy link
Contributor Author

tomkatsu commented Sep 9, 2020

I'm still getting errors on build. See the below output:

MacBook-Pro:drupal-connector tomallen$ git status
On branch develop
Your branch is up to date with 'origin/develop'.

nothing to commit, working tree clean
MacBook-Pro:drupal-connector tomallen$ ./gradlew clean build assemblePlugin

> Task :compileJava
Note: /Users/tomallen/Documents/GitHub/drupal-connector/src/main/java/com/lucidworks/fusion/connector/util/DataUtil.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :test FAILED

com.lucidworks.fusion.connector.service.ConnectorServiceTest > testPrepareDataToUpload_ThrowException FAILED
    org.mockito.exceptions.base.MockitoException at ConnectorServiceTest.java:44
        Caused by: java.lang.UnsupportedOperationException at ConnectorServiceTest.java:44
            Caused by: java.lang.IllegalArgumentException at ConnectorServiceTest.java:44
    java.lang.NullPointerException at ConnectorServiceTest.java:52

com.lucidworks.fusion.connector.service.DrupalContentCrawlerTest > testStartCrawling FAILED
    org.mockito.exceptions.misusing.UnfinishedMockingSessionException at DrupalContentCrawlerTest.java:43
    java.lang.NullPointerException at DrupalContentCrawlerTest.java:51

com.lucidworks.fusion.connector.service.DrupalContentCrawlerTest > testStartCrawling_throwException FAILED
    org.mockito.exceptions.misusing.UnfinishedMockingSessionException at DrupalContentCrawlerTest.java:43
    java.lang.NullPointerException at DrupalContentCrawlerTest.java:51

7 tests completed, 3 failed, 1 skipped

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///Users/tomallen/Documents/GitHub/drupal-connector/build/reports/tests/test/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
5 actionable tasks: 5 executed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants