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 dedicated benchmarking test suite #34

Merged
merged 7 commits into from Jan 10, 2019
Merged

Add dedicated benchmarking test suite #34

merged 7 commits into from Jan 10, 2019

Conversation

regexident
Copy link
Contributor

@regexident regexident commented Dec 22, 2018

Admittedly the _ closure: (() -> ()) -> () + closure { … } mumbo jumbo isn't the prettiest code I've ever written, but then again XCTest isn't a particularly usable testing framework either. 🤷🏻‍♂️

Xcode attaches the measurements popover to literal code occurrences of self.measure { … } itself, making the whole mess required in the first place. 🙄
(All while only supporting a single self.measure { … } per unit test. 🤦🏻‍♂️)

@regexident regexident changed the title Added dedicated benchmarking test suite Add dedicated benchmarking test suite Dec 22, 2018
@codecov
Copy link

codecov bot commented Dec 22, 2018

Codecov Report

Merging #34 into master will increase coverage by 1.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #34      +/-   ##
==========================================
+ Coverage    73.4%   74.51%   +1.11%     
==========================================
  Files          30       30              
  Lines        1440     1440              
==========================================
+ Hits         1057     1073      +16     
+ Misses        383      367      -16
Impacted Files Coverage Δ
...XMLCoder/Decoder/XMLUnkeyedDecodingContainer.swift 24.42% <ø> (ø) ⬆️
...s/XMLCoder/Decoder/XMLKeyedDecodingContainer.swift 85.1% <ø> (ø) ⬆️
Sources/XMLCoder/Box/KeyedBox.swift 100% <100%> (ø) ⬆️
Sources/XMLCoder/Auxiliaries/XMLElement.swift 96.74% <0%> (+1.62%) ⬆️
Sources/XMLCoder/Encoder/XMLEncoder.swift 81.05% <0%> (+6.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9d2ac8...d0ca447. Read the comment docs.

MaxDesiatov
MaxDesiatov previously approved these changes Dec 22, 2018
MaxDesiatov
MaxDesiatov previously approved these changes Dec 22, 2018
MaxDesiatov
MaxDesiatov previously approved these changes Dec 22, 2018
Copy link
Collaborator

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

thanks @regexident, but there are a few small changes needed: removing print and trailing whitespaces

Tests/XMLCoderTests/BenchmarkTests.swift Outdated Show resolved Hide resolved
Tests/XMLCoderTests/BenchmarkTests.swift Outdated Show resolved Hide resolved
MaxDesiatov
MaxDesiatov previously approved these changes Dec 22, 2018
@MaxDesiatov
Copy link
Collaborator

hm, now a benchmark test fails on CI...

@regexident
Copy link
Contributor Author

Yeah, I noticed that, too. 🤨
It didn't before, but that's because I had a bug in the tests only ever coding nulls.

@regexident
Copy link
Contributor Author

These benchmarks currently cause XMLCoder to hard crash with a fatal error.
Merging #41 will cause the benchmarks to just fail with an error.

MaxDesiatov pushed a commit that referenced this pull request Dec 23, 2018
There were way too many functions returning `throw -> _?` in `XMLDecoder`, which should only ever return `throw -> _` (turning the `nil` case into an error of its own).

👷🏻‍♀️ I also managed to get rid of quite a bunch of force-unwraps.
Especially the ones eventually leading to crashes in #38 and #34. 💥

* Make error handling in `XMLDecoder` simpler & safer
* SwiftFormat and related cleanup
@MaxDesiatov MaxDesiatov merged commit 43aa825 into CoreOffice:master Jan 10, 2019
@regexident regexident deleted the benchmarks branch January 11, 2019 08:57
MaxDesiatov pushed a commit that referenced this pull request May 22, 2019
#34 encounters a crasher when trying to decode nested arrays.

This PR tries to add some more tests for nested keyed/unkeyed collections:

- `[String: [Int]]` (dictionary of arrays)
- `[String: [String: Int]]` (dictionary of dictionaries)
- `[[Int]]` (array of arrays)
- `[[String: Int]]` (array of dictionaries)

* Added tests for nested complex (keyed/unkeyed) boxes
* Fix trailing whitespace and indentation
* Remove whitespace between doc comment and code
* Avoid conflict in XMLDecoder.swift
arjungupta0107 pushed a commit to salido/XMLCoder that referenced this pull request Jun 26, 2020
CoreOffice#34 encounters a crasher when trying to decode nested arrays.

This PR tries to add some more tests for nested keyed/unkeyed collections:

- `[String: [Int]]` (dictionary of arrays)
- `[String: [String: Int]]` (dictionary of dictionaries)
- `[[Int]]` (array of arrays)
- `[[String: Int]]` (array of dictionaries)

* Added tests for nested complex (keyed/unkeyed) boxes
* Fix trailing whitespace and indentation
* Remove whitespace between doc comment and code
* Avoid conflict in XMLDecoder.swift
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.

None yet

3 participants