openwhisk-cli
openwhisk-cli copied to clipboard
How shall we deal with the traditional commands: ./gradlew test and ./gradlew build
The question is what is our suggestions to deal with these commands, ./gradlew test and ./gradlew build? If we are still in favor of them, can we overwrite them by calling the current ./gradlew goTest and ./gradlew compile. If we are not in favor of them, is there a way to remove or inhibit them?
@jonpspri Could you look at this question, as the expert of gogradle? Thx.
When we run the commands, ./gradlew test and ./gradlew build, brought in by gogradle plugin, the test cases under openwhisk/test will be running as below:
Step 1/3 : FROM dockerskeleton
---> b87a7e46c988
Step 2/3 : ENV FLASK_PROXY_PORT 8080
---> Using cache
---> f6a1758b06ff
Step 3/3 : CMD ["/bin/bash", "-c", "tail -f /dev/null"]
---> Using cache
---> c7a6360cc3aa
Successfully built c7a6360cc3aa
Successfully tagged badproxy:latest
> Task :tests:dat:blackbox:badproxy:distDocker
Fri Jan 26 09:59:23 EST 2018: Executing 'docker build -t badproxy /Users/vincent/workspace/openwhisk/tests/dat/blackbox/badproxy'
Building 'badproxy' took 0.168 seconds
> Task :tests:dat:blackbox:badproxy:tagImage
Fri Jan 26 09:59:23 EST 2018: Executing 'docker tag badproxy whisk/badproxy:latest'
<========-----> 66% EXECUTING [9s]
> :clitests:test > 0 tests completed
> :clitests:test > Executing test actionContainers.ActionProxyContainerTests
Test cases of scala in openwhisk-cli still depends on the scala code under openwhisk/test. I think that is the reason for this behavior.
Which tests are valid?
In the travis build we run a subset of openwhisk tests to be sure CLI integration runs correctly, which is why test remains configured as it is. In my ideal world, we'd move the needed code for those tests into the 'incubator-openwhisk-cli' repository and eliminate the need for the Scala in the 'incubator-openwhisk' repository, but that may not be feasible -- I'll look for others' opinion on that.
If we could do that relocation, that would make life easier. Otherwise, we can do some tinkering to overwrite the behavior of the :clitests:test task.
Only the test cases under incubator-openwhisk-cli are what we need to run. We should not bother the the test cases located in incubator-openwhisk.
Rewriting the test cases in Go is definitely going to remove the dependency on incubator-openwhisk code.
As we saw, #215 narrowed down the number of test cases run. Now let's discuss two other points:
- Should './gradlew test' run 'goTest'? -- there is a challenge around how gogradle, buildTags and goTest interact (see #212), so if we can live without this for now, that's probably better.
- Should './gradlew build' run 'compile'? -- this should be a straightforward dependency add.
build
should definitely run compile
and compile
can be removed. Currently it seems like build
runs the tests.
build
should run tests. Here's the chart of standard java dependencies, pulled from the Gradle docs.
I'd suggest we do our best to adhere to this expected behavior, which in this case includes build running test.