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

Distinguish between unit and integration tests repository should build by default #18

Open
ManuelB opened this issue Oct 26, 2014 · 0 comments

Comments

@ManuelB
Copy link

ManuelB commented Oct 26, 2014

Hi,
I just cloned your repository and made the following experience:

git clone https://github.com/gengo/gengo-java.git
cd gengo-java/
mvn install
...
[INFO] Surefire report directory: /Users/manuel/Projects/gengo-java/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.gengo.client.AccountTest
Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.194 sec <<< FAILURE!
Running com.gengo.client.JobsTest
Tests run: 3, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.038 sec <<< FAILURE!
Running com.gengo.client.OrderTest
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.004 sec <<< FAILURE!
Running com.gengo.client.ServiceTest
Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.015 sec <<< FAILURE!

Results :

Tests in error: 
  testGetAccountStats(com.gengo.client.AccountTest): This API requires authentication. Both a public and private key must be specified.
  testGetAccountPreferredTranslators(com.gengo.client.AccountTest): This API requires authentication. Both a public and private key must be specified.
  testGetAccountBalance(com.gengo.client.AccountTest): This API requires authentication. Both a public and private key must be specified.
  testPostJobsFiles(com.gengo.client.JobsTest): HTTP POST failed
  testPostJobsText(com.gengo.client.JobsTest): This API requires authentication. Both a public and private key must be specified.
  testGetOrder(com.gengo.client.OrderTest): This API requires authentication. Both a public and private key must be specified.
  testGetServiceLanguagePairs(com.gengo.client.ServiceTest): This API requires authentication. Both a public and private key must be specified.
  testGetServiceLanguages(com.gengo.client.ServiceTest): This API requires authentication. Both a public and private key must be specified.

Tests run: 9, Failures: 0, Errors: 8, Skipped: 0
...

So directly building the source code does not work because test cases are failing.

I would recommend to distinguish between unit tests and integration tests. A unit test mocks all integrations and does not need any external system. You might want to use the following project to convert your current tests to real unit tests:

https://github.com/ManuelB/mockito-caching-spy

Further you can have integration tests which are only executed during releasing the software.

To solve the problem I did:

mvn -DskipTests=true install

Hope that helps
Manuel

dpursehouse added a commit to dpursehouse/gengo-java that referenced this issue Oct 16, 2015
Change-Id: Icb5ce73aacf59289db849ae62aefb69eeb409f09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant