Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Implement system test #336

Closed
wants to merge 29 commits into from
Closed

Conversation

amaya382
Copy link
Contributor

@amaya382 amaya382 commented Sep 7, 2016

related with #323

Usage and example are written in systemtest/README.md, please refer to it

@myui myui added this to the v0.4 milestone Sep 7, 2016
@myui myui self-assigned this Sep 7, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.007%) to 33.853% when pulling 242dfaf on amaya382:feature/systemtest into df4f4dd on myui:master.

@coveralls
Copy link

coveralls commented Sep 7, 2016

Coverage Status

Coverage decreased (-0.7%) to 34.162% when pulling 242dfaf on amaya382:feature/systemtest into df4f4dd on myui:master.

@amaya382 amaya382 force-pushed the feature/systemtest branch 2 times, most recently from 048a4cf to aa5388b Compare September 8, 2016 08:46
@coveralls
Copy link

coveralls commented Sep 8, 2016

Coverage Status

Coverage decreased (-1.002%) to 33.858% when pulling 48a4fc9 on amaya382:feature/systemtest into df4f4dd on myui:master.

@coveralls
Copy link

coveralls commented Sep 8, 2016

Coverage Status

Coverage decreased (-1.007%) to 33.853% when pulling 48a4fc9 on amaya382:feature/systemtest into df4f4dd on myui:master.

@coveralls
Copy link

coveralls commented Sep 8, 2016

Coverage Status

Coverage decreased (-1.002%) to 33.858% when pulling 48a4fc9 on amaya382:feature/systemtest into df4f4dd on myui:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 34.157% when pulling 48a4fc9 on amaya382:feature/systemtest into df4f4dd on myui:master.

@coveralls
Copy link

coveralls commented Sep 8, 2016

Coverage Status

Coverage decreased (-1.002%) to 33.858% when pulling 48a4fc9 on amaya382:feature/systemtest into df4f4dd on myui:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 34.067% when pulling 0b01896 on amaya382:feature/systemtest into df4f4dd on myui:master.

@coveralls
Copy link

coveralls commented Sep 12, 2016

Coverage Status

Coverage decreased (-1.1%) to 33.764% when pulling 0b01896 on amaya382:feature/systemtest into df4f4dd on myui:master.

@coveralls
Copy link

coveralls commented Sep 13, 2016

Coverage Status

Coverage decreased (-1.09%) to 33.766% when pulling d2f0370 on amaya382:feature/systemtest into df4f4dd on myui:master.

Copy link
Contributor

@Lewuathe Lewuathe left a comment

Choose a reason for hiding this comment

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

@amaya382 So sorry for late reviewing. The system test module example almost passed except for test3 case. And I added some comments. Could you check these comments again? After passing test3, it's ready to be merged, I think.

In addition could you update the license header as described here. Please refer HIVEMALL-12.
Thanks!

public void test4() throws Exception {
// test on HiveRunner once only
predictor.expect(Throwable.class); // you can use systemtest w/ other rules
team.set(HQ.fromStatement("invalid queryyy")); // this query throws an exception
Copy link
Contributor

Choose a reason for hiding this comment

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

It shows Cannot resolve method. We need to pass dummy expected argument here.

public void test3() throws Exception {
// test on HiveRunner once only
// auto matching by files which name is `test3` in `case/` and `answer/`
team.set(HQ.autoMatchingByFileName("test3", ci)); // unordered test
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be

team.set(HQ.autoMatchingByFileName("test3"), ci);


The above requires following files

* `systemtest/src/test/resources/hivemall/HogeTest/init/color.tsv` (`systemtest/src/test/resources/${path/to/package}/${className}/init/${fileName}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to rename HogeTest to QuickExample here.

pink 255 192 203
```

* `systemtest/src/test/resources/hivemall/HogeTest/case/test3` (`systemtest/src/test/resources/${path/to/package}/${className}/case/${fileName}`)
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto: HogeTest

```sql
-- write your hive queries
-- comments like this and multiple queries in one row are allowed
SELECT blue FROM color WHERE name = 'lavender';SELECT green FROM color WHERE name LIKE 'orange%'
Copy link
Contributor

Choose a reason for hiding this comment

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

We have to add semicolon (;) at the end of line, otherwise interpreted as 2 queries.

}
}

//// execute RawHQ
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: Could you align comment format? Especially the number of /s.


if (ordered) {
// take order into consideration (like list)
Assert.assertThat(Arrays.asList(answer.split(IO.RD)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Assert.assertThat requires actual as first argument. So please put result in first argument.

} else {
// not take order into consideration (like multiset)
Assert.assertThat(Arrays.asList(answer.split(IO.RD)),
Matchers.containsInAnyOrder(result.toArray()));
Copy link
Contributor

Choose a reason for hiding this comment

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

When I ran QuickExample#test3 described README, I faced below error.

java.lang.AssertionError:
Expected: iterable over ["165", "69"] in any order
     but: Not matched: "165    69"
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    at org.junit.Assert.assertThat(Assert.java:956)
    at org.junit.Assert.assertThat(Assert.java:923)
    at hivemall.systemtest.runner.SystemTestRunner.matching(SystemTestRunner.java:202)
    at hivemall.systemtest.runner.SystemTestTeam.run(SystemTestTeam.java:180)
    at hivemall.QuickExample.test3(QuickExample.java:100)

Could you check this matching is working as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Lewuathe I cannot reproduce it. plz check that answer/test3 uses tab characters as delimiter, since several space characters have got mixed in README(will be fixed)

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry I seemed to have mistake to copy answer/test3. I confirmed it works as expected. Thanks.

fileUploadCommitRetryLimit = Integer.valueOf(props.getProperty("fileUploadCommitRetryLimit"));
}

final Properties TDPorps = System.getProperties();
Copy link
Contributor

Choose a reason for hiding this comment

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

s/TDPorps/TDProps/ ?

}
System.setProperties(TDPorps);

client = System.getProperties().size() == TDPorps.size() ? TDClient.newClient() // use $HOME/.td/td.conf
Copy link
Contributor

Choose a reason for hiding this comment

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

Is System.getProperties().size() == TDPorps.size() check meaningful?
TDPorps is already set as system property in L.94. So the size is always same.

@amaya382
Copy link
Contributor Author

@Lewuathe okay, I'll check them in about a week

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 62e3588 on amaya382:feature/systemtest into * on myui:master*.

1 similar comment
@coveralls
Copy link

coveralls commented Nov 16, 2016

Coverage Status

Changes Unknown when pulling 62e3588 on amaya382:feature/systemtest into * on myui:master*.

@myui
Copy link
Owner

myui commented Nov 16, 2016

@amaya382 https://github.com/myui/hivemall/blob/master/bin/format_header.sh is a tool to run header formatting. FYI

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.1%) to 33.742% when pulling f2ae1f7 on amaya382:feature/systemtest into ee244c3 on myui:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-1.1%) to 33.742% when pulling f2ae1f7 on amaya382:feature/systemtest into ee244c3 on myui:master.

@coveralls
Copy link

coveralls commented Nov 17, 2016

Coverage Status

Coverage decreased (-1.1%) to 33.742% when pulling f2ae1f7 on amaya382:feature/systemtest into ee244c3 on myui:master.

Copy link
Contributor

@Lewuathe Lewuathe left a comment

Choose a reason for hiding this comment

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

@amaya382 Thank you so much for updating!
Though I added a trivial comment, it LGTM! 👍

@@ -175,7 +180,7 @@ public final boolean isImmutableTable(final String tableName) {
}
}

////// execute UploadFileHQ
// >>>execute UploadFileHQ
Copy link
Contributor

Choose a reason for hiding this comment

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

trivial: >> instead of >>>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Lewuathe > intends to mean hierarchical structure of argument

@Lewuathe
Copy link
Contributor

@myui Could you check it? If it's okay please merge it.

@myui
Copy link
Owner

myui commented Nov 21, 2016

Sure. Will do after #385 is being merged.

@myui
Copy link
Owner

myui commented Dec 2, 2016

@amaya382 moved to apache/incubator-hivemall#5

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

Successfully merging this pull request may close these issues.

None yet

4 participants