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

Handle module names with spaces #31

Open
ampeixoto opened this issue Oct 19, 2019 · 0 comments
Open

Handle module names with spaces #31

ampeixoto opened this issue Oct 19, 2019 · 0 comments

Comments

@ampeixoto
Copy link

ampeixoto commented Oct 19, 2019

Hello,

My Bitrise workflow is failing to run Android unit tests with the following error:


+------------------------------------------------------------------------------+
| (5) [email protected]                                                  |
+------------------------------------------------------------------------------+
| id: android-unit-test                                                        |
| version: 1.0.0                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2019-10-19T13:21:44Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
Configs:
- ProjectLocation: /bitrise/src
- HTMLResultDirPattern: *build/reports/tests
- XMLResultDirPattern: *build/test-results
- Variant: myvariant
- Module: my app
- Arguments: 
- CacheLevel: only_deps
- IsDebug: true
- DeployDir: /bitrise/deploy
- TestResultDir: /tmp/test_results555072493/test_result921996591

Variants:
Failed to find buildable variants, error: module not found: my app
|                                                                              |
+---+---------------------------------------------------------------+----------+
| x | [email protected] (exit code: 1)                        | 5.31 sec |
+---+---------------------------------------------------------------+----------+
| Issue tracker: ....com/bitrise-steplib/bitrise-step-android-unit-test/issues |
| Source: https://github.com/bitrise-steplib/bitrise-step-android-unit-test    |
+---+---------------------------------------------------------------+----------+

I lookind into the source code of the android-unit-test step (https://github.com/bitrise-steplib/bitrise-step-android-unit-test/blob/master/main.go) and I think a found the problem in the parseVariants() method of the "task.go" file (https://github.com/bitrise-io/go-android/blob/master/gradle/task.go).

Because when I run the command gradlew tasks --all --console=plain --quiet I get lines like the following:

my app:testMyvariantDebugUnitTest - Run unit tests for the myvariantDebug build.

So, as you can see, my module name contains a space character, and in the parseVariants() method the code seems not to handle this very well:

// l: " lintMyflavorokStaging - Runs lint on the MyflavorokStaging build."
l = strings.TrimSpace(l)
// l: "lintMyflavorokStaging - Runs lint on the MyflavorokStaging build."
if l == "" {
    continue
}
// l: "lintMyflavorokStaging"
l = strings.Split(l, " ")[0]
var module string

split := strings.Split(l, ":")

Am I seeing this right or am I missing something?

UPDATE
I renamed the module name to remove the space, and it works now. So that seems to be the problem.

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