Skip to content
This repository was archived by the owner on Aug 15, 2019. It is now read-only.

Add integration test with layers/node/converter when we modify version.ts #1372

Merged
merged 20 commits into from
Nov 5, 2018

Conversation

dsmilkov
Copy link
Contributor

@dsmilkov dsmilkov commented Nov 1, 2018

Run a 3rd travis job (integration) when the src/version.ts file is modified.

The integration job clones layers/node/converter and tests those repos against core@master, giving the PR author a heads up before they make a new release of core.

https://travis-ci.org/tensorflow/tfjs-core/builds/449534806 is an example of a Travis run. See the 3rd job (TO_TEST=integration).

status

Details:

  • rename yarn test-travis to yarn run-browserstack to better reflect the task
  • move all travis-related scripts under yarn test-travis to align core with the other repos (layers & node).

Towards tensorflow/tfjs#848

DEV


This change is Reviewable

@dsmilkov dsmilkov changed the title WIP Add integration test with layers and node when we touch version.ts Add integration test with layers and node when we modify version.ts Nov 1, 2018
@dsmilkov
Copy link
Contributor Author

dsmilkov commented Nov 1, 2018

cc @tafsiri @annxingyuan

Copy link
Collaborator

@caisq caisq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. Please see my comments below.

Reviewable status: 0 of 1 approvals obtained (waiting on @dsmilkov, @nsthorat, @caisq, @nkreeger, and @pyu10055)


scripts/test-integration.sh, line 17 at r2 (raw file):

function test () {

If one of the tests below fail, how do you know from the Travis status? There is no checking of the exit code.

You can do something like the following

# ...
yarn && yarn link-local '@tensorflow/tfjs-core' && ./scripts/test-travis.sh
LAYERS_EXIT_CODE=$?

# ...
yarn && yarn link-local '@tensorflow/tfjs-core' && ./scripts/test-travis.sh
NODE_EXIT_CODE=$?

# ...
yarn && yarn link-local '@tensorflow/tfjs-core' && ./scripts/test-travis.sh
CONVERTER_EXIT_CODE=$?

# Then at the end of the function, check the values of LAYERS_EXIT_CODE, NODE_EXIT_CODE and CONVERTER_EXIT_CODE, one by one and use them to print a summary and determine the final return code of the function

Copy link
Contributor Author

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @caisq, @nsthorat, @nkreeger, and @pyu10055)


scripts/test-integration.sh, line 17 at r2 (raw file):

Previously, caisq (Shanqing Cai) wrote…
function test () {

If one of the tests below fail, how do you know from the Travis status? There is no checking of the exit code.

You can do something like the following

# ...
yarn && yarn link-local '@tensorflow/tfjs-core' && ./scripts/test-travis.sh
LAYERS_EXIT_CODE=$?

# ...
yarn && yarn link-local '@tensorflow/tfjs-core' && ./scripts/test-travis.sh
NODE_EXIT_CODE=$?

# ...
yarn && yarn link-local '@tensorflow/tfjs-core' && ./scripts/test-travis.sh
CONVERTER_EXIT_CODE=$?

# Then at the end of the function, check the values of LAYERS_EXIT_CODE, NODE_EXIT_CODE and CONVERTER_EXIT_CODE, one by one and use them to print a summary and determine the final return code of the function

Ah good catch. I initially had set -e at the top of the script so it returns code 1 if any command fails, but since this is an integration test, seeing full status is useful. Done.

Copy link
Contributor Author

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @caisq, @nsthorat, @nkreeger, and @pyu10055)


scripts/test-integration.sh, line 17 at r2 (raw file):

Previously, dsmilkov (Daniel Smilkov) wrote…

Ah good catch. I initially had set -e at the top of the script so it returns code 1 if any command fails, but since this is an integration test, seeing full status is useful. Done.

I tested layers/node/converter and none of them return a negative code number (they all return 1), so summing those 3 codes as a final result should be ok

Copy link
Collaborator

@caisq caisq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @caisq, @dsmilkov, @nsthorat, @nkreeger, and @pyu10055)


scripts/test-integration.sh, line 45 at r3 (raw file):

if [ $LAYERS_EXIT_CODE -ne 0 ]; then echo 'Layers build failed'; fi

Can we do echoing not only when something fails, but also when something passes?

E.g.,

=== INTEGRATION TEST RESULTS ===
tfjs-layers: PASS
tfjs-node: FAIL
tfjs-converter: PASS

Final result: FAIL

That gives who's looking at it a complete picture.

Copy link
Contributor Author

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @caisq, @nsthorat, @nkreeger, and @pyu10055)


scripts/test-integration.sh, line 45 at r3 (raw file):

Previously, caisq (Shanqing Cai) wrote…
if [ $LAYERS_EXIT_CODE -ne 0 ]; then echo 'Layers build failed'; fi

Can we do echoing not only when something fails, but also when something passes?

E.g.,

=== INTEGRATION TEST RESULTS ===
tfjs-layers: PASS
tfjs-node: FAIL
tfjs-converter: PASS

Final result: FAIL

That gives who's looking at it a complete picture.

Done. Added screenshot of output to the PR description

Copy link
Collaborator

@caisq caisq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @caisq, @dsmilkov, @nsthorat, @nkreeger, and @pyu10055)


scripts/test-integration.sh, line 60 at r4 (raw file):

print_status "${RED}Final result" "$FINAL_EXIT_CODE" "${NC}"

I think you should use green or default white color when the final result is pass. Red should only be used when the final result is fail.

Copy link
Contributor Author

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @caisq, @nsthorat, @nkreeger, and @pyu10055)


scripts/test-integration.sh, line 60 at r4 (raw file):

Previously, caisq (Shanqing Cai) wrote…
print_status "${RED}Final result" "$FINAL_EXIT_CODE" "${NC}"

I think you should use green or default white color when the final result is pass. Red should only be used when the final result is fail.

Done (did blue/red => better for color blind folks)

Copy link
Contributor

@nsthorat nsthorat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 6 files at r1, 1 of 3 files at r2, 1 of 1 files at r5.
Reviewable status: :shipit: complete! 1 of 1 approvals obtained (waiting on @caisq, @nsthorat, @nkreeger, and @pyu10055)

@dsmilkov dsmilkov changed the title Add integration test with layers and node when we modify version.ts Add integration test with layers/node/converter when we modify version.ts Nov 2, 2018
Copy link
Contributor

@nkreeger nkreeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 2 of 1 approvals obtained (waiting on @caisq, @dsmilkov, @nkreeger, and @pyu10055)


.travis.yml, line 23 at r5 (raw file):

node_js: '8'

Food for thought - Node 10 is now LTS https://nodejs.org/en/

@dsmilkov dsmilkov merged commit 7090a7c into master Nov 5, 2018
@dsmilkov dsmilkov deleted the travis-make-version branch November 5, 2018 16:11
dsmilkov added a commit that referenced this pull request Nov 7, 2018
#1379 added a unit test that failed in travis due to numerical precision: https://travis-ci.org/tensorflow/tfjs-core/jobs/451654174#L801

This PR:
- fixes that test
- Also fixes `test-travis.sh` to make sure we don't forward webgl --> cpu except for the last browser run -- probably caused during conflict resolving of #1371 and #1372 (https://reviewable.io/reviews/tensorflow/tfjs-core/1371#-LQ_a2y92YYLRMiYWqhC)

DEV
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants