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

Add e2e test #16

Merged
merged 1 commit into from
Nov 21, 2019
Merged

Conversation

foriequal0
Copy link
Contributor

Test fails, but it's a problem that needs to be addressed in other PRs.

Copy link
Collaborator

@sgkim126 sgkim126 left a comment

Choose a reason for hiding this comment

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

How about removing travis.yml?

test/e2e_test.sh Outdated Show resolved Hide resolved
test/e2e_test.sh Outdated
--forward "http://127.0.0.1:$SERVER_PORT" 2>&1 | tag "[SERVER]" &

function finish {
kill $(jobs -p) || true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is || true needed?

Copy link
Contributor Author

@foriequal0 foriequal0 Oct 28, 2019

Choose a reason for hiding this comment

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

Processes may die between jobs and kill. kill will complain that 'there is no such process', and because of set -e, the script halts its execution there. Should I set +e on the exit trap?

Copy link
Collaborator

@sgkim126 sgkim126 Oct 30, 2019

Choose a reason for hiding this comment

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

I'm confused about the behavior of set -e. Doesn't it make e2e_test.sh stop when jobs exits with non-zero?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it does. set -e turns on the behavior, and set +e turns off it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, if it does, why do you need || true? The script will terminate when jobs exit with a non-zero value.

Copy link
Contributor Author

@foriequal0 foriequal0 Oct 30, 2019

Choose a reason for hiding this comment

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

I wanted to make sure wait is called. It waits for remaining child processes to clean up and reports whether they are terminated properly.

test/json_cmp.py Outdated Show resolved Hide resolved
@foriequal0 foriequal0 force-pushed the feature/testcase branch 2 times, most recently from f389fb2 to 9f0ee62 Compare October 28, 2019 03:30
@foriequal0 foriequal0 merged commit 2afcb52 into CodeChain-io:master Nov 21, 2019
@foriequal0 foriequal0 deleted the feature/testcase branch November 21, 2019 09:25
@foriequal0 foriequal0 mentioned this pull request Nov 21, 2019
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

Successfully merging this pull request may close these issues.

2 participants