linkedin / linkedin/pygradle

my unit tests are not being run

Open
#175 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
603
Forks
142
PR merge metrics
No merged PRs in 30d

Description

Everytime I try to run my build, the python code (all of it, both class and test class) gets compiled. I know this because if I introduce a syntax error into either the class or the test, the build will fail with a compile error. My "production" python classes are stored in src/main/python and my test classes are in src/test/python (they will fail the build if there is an error on a python file in src/test/python) Here is where everything goes sideways: **NO MATTER WHERE I PUT THE PYTHON TEST SOURCE, PYGRADLE NEVER RUNS MY TESTS** . I always get the following:
============================= test session starts ==============================
platform darwin -- Python 2.7.10, pytest-2.9.1, py-1.4.29, pluggy-0.3.1
rootdir: /Users/user1/Documents/git/myproj, inifile:
plugins: cov-2.2.1
collected 0 items

========================= no tests ran in 0.00 seconds =========================
***** WARNING: You did not write any tests! *****

Here is my build.gradle:
`plugins {
// newer version
id "com.linkedin.python-sdist" version "0.4.9"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'jacoco'

group = 'com.mycompany'
version = '1.0.0'

sourceCompatibility = 1.8
jar {
manifest {
attributes 'Implementation-Title': 'Gradle Quickstart',
'Implementation-Version': version
}
}

repositories {
mavenCentral()
pyGradlePyPi()
maven {
url "http://ox.gluu.org/maven"
}

}

dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2.2'
compile 'org.springframework.boot:spring-boot-starter-security'
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-thymeleaf:1.5.9.RELEASE'
compile 'org.springframework.cloud:spring-cloud-starter-oauth2:1.2.1.RELEASE'
compile 'org.springframework.security:spring-security-ldap:5.0.0.RELEASE'
compile 'org.springframework.security:spring-security-jwt:1.0.8.RELEASE'
compile 'org.springframework.data:spring-data-redis:1.7.7.RELEASE'
compile 'redis.clients:jedis:2.8.2'
compile 'org.xdi:oxTrust:1.3.2.Final'
testCompile 'org.springframework.boot:spring-boot-starter-test:1.5.9.RELEASE'
testCompile 'org.apache.httpcomponents:httpclient'
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'org.testng', name: 'testng', version: '5.14.10'
python 'pypi:requests:2.9.1'
test 'pypi:mock:1.3.0'
}

test {
systemProperties 'property': 'value'
}

python {
// testDir = file('src/test/python')
}
`

Any help would be greatly appreciated and I am running out of time on this project!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with build.gradle, especially the python configuration, dependency declarations, and test task, then inspect the src/main/python and src/test/python layouts. Run the build and review the pytest output showing zero collected items. Done means the configured Python tests are discovered and executed during the build.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.