Skip to content

Commit

Permalink
test quora: reduce checking
Browse files Browse the repository at this point in the history
Because tsv file is too big(404,290 rows).

Before this change:

```bash
$ time ruby -I lib test/run-test.rb -t "/QuoraDuplicateQuestionPairTest/" -v
Loaded suite test
Started
QuoraDuplicateQuestionPairTest:
  test: #each:                                                         .: (17.476536)

Finished in 17.476912 seconds.
-------------------------------------------------------------------------------------
1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-------------------------------------------------------------------------------------
0.06 tests/s, 0.06 assertions/s

real    0m18.117s
user    0m17.554s
sys     0m0.383s
```

After this change:

$ time ruby -I lib test/run-test.rb -t "/QuoraDuplicateQuestionPairTest/" -v
Loaded suite test
Started
QuoraDuplicateQuestionPairTest:
  test: #each:                                                          .: (0.001124)

Finished in 0.001461 seconds.
-------------------------------------------------------------------------------------
1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
-------------------------------------------------------------------------------------
684.46 tests/s, 684.46 assertions/s

real    0m0.595s
user    0m0.376s
sys     0m0.126s

Refs red-data-tools#188.
  • Loading branch information
tikkss committed Jan 19, 2024
1 parent 3f33534 commit 2d7a67b
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions test/test-quora-duplicate-question-pair.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,13 @@ def record(*args)
end

test("#each") do
records = @dataset.each.to_a
assert_equal([
404290,
record(0,
1,
2,
"What is the step by step guide to invest in share market in india?",
"What is the step by step guide to invest in share market?",
false),
record(404289,
537932,
537933,
"What is like to have sex with cousin?",
"What is it like to have sex with your cousin?",
false),
],
[
records.size,
records.first,
records.last,
])
records = @dataset.each
assert_equal(record(0,
1,
2,
"What is the step by step guide to invest in share market in india?",
"What is the step by step guide to invest in share market?",
false),
records.first)
end
end

0 comments on commit 2d7a67b

Please sign in to comment.