Commit Graph
140 Commits
Author SHA1 Message Date
Johannes Weiss c2c725044a allow deprecated tests to test deprecated functionality (#1271)
Motivation:

It's important to also test deprecated functionliaty. One way of
achieving this without warnings is to also deprecate the tests that test
this deprecated functionality. Unfortunately, on Linux we need to
generate lists of tests which would then reference deprecated tests
(which gives us a warning).

Modifications:

Deprecate test suites and the main test runner all the way to the top so
never get warnings.

Result:

Possible to test deprecated functionlity without warnings.
2019-11-27 14:26:51 +00:00
Cory Benfield 5a7b23d8b5 Fix Dash docset generation. (#1256)
Motivation:

Jazzy generates Dash docsets for us, but currently they don't work. This
is because the URLs they generate aren't matching the URL scheme we
have. That makes them next to useless.

Modifications:

Add a trailing '/' to the root URL.

Result:

Calls to Ruby's URI.join won't blow away the final path component in the
root URL, which means that the docsets will have correct URLs going
forward.
2019-11-20 13:41:02 +00:00
Johannes Weiss 1ca4c2113c perf tests: switch printed metric to mean (#1244)
Motivation:

We should print the same metric that we compare with.

Modifications:

Switch the printed metric to the one selected in `::METRIC`.

Result:

More correct printouts.
2019-11-13 19:07:50 +00:00
Johannes Weiss ca69149d5f api breakage tester: fetch all refs (#1076)
Motivation:

To be able to use SHA sums as git versions, we need to pull all the refs
to we get even the commit SHAs from PRs. That's important so CI can use
this script.

Modifications:

Fetch `+refs/pull/*:refs/remotes/origin/pr/*` refs.

Result:

Should be able to be usable in CI across forks.
2019-07-17 18:23:45 +01:00
Johannes Weiss 5f8d3f0b40 workaround SR-11143 for api-digester: pass -sdk / on Linux (#1068)
Motivation:

swift-api-digester requires to be passed `-sdk /` on Linux.

Modifications:

Pass `-sdk /` on Linux and the SDK directory on Darwin.

Result:

check_no_api_breakages works on Linux.
2019-07-16 12:40:51 +01:00
Konrad `ktoso` Malawski ed3bca3131 check breakages: fail loudly when unable to checkout tag (#1060)
One line description of your change

Motivation:

When using the script ad hoc to verify something you may have forgotten to pull all tags,
the script then fails mysteriously in silence and no output. Detective work can then lead the script mysteriously stopping after a checkout:

```
+ cd /tmp/.check-api_1Q1rvO/repo
+ git checkout 1.1.0
$ ...
```

which reminds you to perform a fetch; it would be nicer if it told us about the issue explicitly though.

Modifications:

Don't silence `git checkout` all error output, though use quiet mode so no progress is printed.

Result:

Script fails nicer and reminds you to perform a git fetch if you forgot to do so.

e.g.

```
[5/5] Merging module Metrics
error: pathspec '1.1.0' did not match any file(s) known to git
```
2019-07-09 15:51:40 +01:00
George Barnett 07e7e01c76 Check jq is available before checking API breakages (#1058)
* Check jq is available before checking API breakages

Motivation:

If jq wasn't installed the API breakage script would erronesouly say
that there were no breaking API changes. That's pretty bad.

Modifications:

Check jq is available before running the check. Updated the usage
message to specify that a Swift 5.1+ toolchain is required.

Result:

More correctness.
2019-07-04 18:47:21 +01:00
Johannes Weiss 069fcde4c5 docs: add forgotten modules (#1050)
Motivation:

Embarrassingly, we forgot a bunch of modules in the documentation.

Modifications:

Add the forgotten modules.

Result:

Better docs.
2019-06-23 16:33:47 +01:00
Johannes Weiss 448a0ba8c8 analyze_performance_results: switch to "min" instead of "mean" (#1044)
Motivation:

Mean is not a great aggregation function because it's not resilient
against outliers at all, so let's switch to min.

Modifications:

Switch 'mean' to 'min' for aggregation.

Result:

Aggregation function that's more resilient against outliers.
2019-06-19 16:10:43 +01:00
Johannes Weiss 0357118bee Add check_no_api_breakages, a script to check public API breakages (#1016)
Motivation:

It's incredibly hard not to accidentally break the public API, so let's
automate that :).

Modifications:

Add the first version of a public API check script.

Result:

Fewer public API breakages.
2019-05-23 13:15:46 +01:00
tomer doron c1aff57ba4 add performance analysis docker-compose setup and script (#1013)
motivation: prepare to run performance tests in ci

changes:
* add performance-test docker-compose task
* add script that can parse the performance test suite results and compare between two result-sets
* add generic shell docker-compose task
2019-05-23 11:37:21 +01:00
Johannes Weiss 5d1d59868d new alloc counter tests (#996) 2019-05-09 14:27:29 +01:00
JP Simard f6692f5c37 Add 'Show on GitHub' link to API docs (#977)
* Add 'Show on GitHub' link to API docs

Addresses #955

* Remove trailing slash
2019-04-23 10:21:41 +01:00
Johannes Weiss 8e59048aaf API docs: repo switcher
Motivation:

API docs should be cross-linked.

Modifications:

Cross-link them.

Result:

better API docs
2019-03-31 16:18:35 +01:00
Johannes Weiss 8d5994be5f update the podspec generator to require Swift 5.0 (#929)
Motivation:

Our podspecs should also correctly require Swift 5.

Modifications:

require Swift 5 in the podspec generator.

Result:

better podspecs for NIO2.
2019-03-26 15:50:55 +00:00
Johannes Weiss d3e611f3de allow 2017-2019 copyright headers (#790)
Motivation:

Previously we required all copyright headers to be 2017-2018 but now
that's not the only allowed string anymore.

Modifications:

allow 2017-2019 besides 2017-2018

Result:

Happy New Year
2019-01-29 15:17:01 +00:00
Cory Benfield 3659a4a973 Update list_topsorted_dependencies script. (#723)
Motivation:

Newer versions of SwiftPM for the Swift 5 release have changed the output
format of swift package dump-package. This has broken our
list_topsorted_dependencies script. This script is highly useful, so we'd
like to keep it working.

The discussion on SR-9191 suggests that SwiftPM considers this format
changeable at any time, so we may need to make a change like this in future.
We may want to consider writing tests for this script to ensure its continued good functioning.

Modifications:

- Amended the jq scripts to parse the new JSON format.

Result:

list_topsorted_dependencies will work with Swift 5 development copies of
SwiftPM. Note that this will break this script with earlier copies of SwiftPM,
but as we only support Swift 5 on the master branch this change is safe to
make.
2019-01-02 15:17:40 +00:00
Norio Nomura 0a5f4b7ba4 Pass --module-version and --root-url parameters to jazzy (#700)
* Pass `--module-version` and `--root-url` parameters to `jazzy`

### Motivation:

It would be good if the API document was distributed as a docset that can be installed in Dash, like [Yams](https://www.jpsim.com/Yams/).

### Modifications:

Pass `--module-version` and `--root-url` parameters to `jazzy`.

### Result:

Jazzy generates docsets and add "Install in Dash" link to `index.html`.

* Apply review: Avoid appending `args`
2018-12-18 09:31:55 +00:00
Johannes Weiss 9bae007a15 use umbrella headers for C modules (#636)
Motivation:

SwiftPM only generates fully usable clang modules for C modules if they
have umbrella headers. Therefore, adding a generated NIO.xcodeproj to
another Xcode project as a sub-project never worked.
To make a header an umbrella header you need to name them _exactly_ like
the module.

Modifications:

give each C module an umbrella header

Result:

generated NIO Xcode projects can be used as sub-projects.
2018-10-19 14:49:43 +01:00
Albert Aleksieiev a59293cbcd add Android support (#609)
### Motivation:

make swift-nio compatible with Android, and pass all test in Android.

### Modifications:

* add missed `ifaddrs` implementation
* add missed thread related functions - `CNIOLinux_pthread_getname_np`, `CNIOLinux_pthread_setaffinity_np` and `CNIOLinux_pthread_getaffinity_np`
* fix types incositency between Linux and Android, e.g. `Epoll.swift` class
* make bytes counter explicitely 64bits to avoid overflow on 32bit, in `PendingWritesManager.swift` and `PendingDatagramWritesState.swift`
* fix issue with Unix domain socket, first byte need to be zero in Android
* several incosistency fixes between Linux and Android api.

### Result:

now swift-nio works on Android. All tests passed!
2018-09-27 11:32:43 +01:00
Cory Benfield 284409625c Add Cocoapods podspec generation. (#568)
Motivation:

A number of users have asked for the ability to install SwiftNIO
via Cocoapods. This is an entirely reasonable request, so let's
do it.

Modifications:

- Added a script that can generate, and optionally upload,
  podspecs.
- Made a slight modification to the dependency script to provide
  target-specific dependencies.

Result:

Users can use cocoapods if they prefer.
2018-08-14 18:37:42 +01:00
Johannes Weiss 8078cc8e04 put the compare perf script into the repo (#564)
Motivation:

For a long while I had a script which runs NIO's performance tests
against different Swift toolchains. It should be in the repository.

Modifications:

add scripts/compare_perf_of_swift_versions.sh

Result:

everybody can run the performance tests against different Swift versions
2018-08-10 12:35:44 +01:00
Johannes Weiss a7fee8d98f script to list the topsorted dependencies (#562)
Motivation:

Sometimes it's useful to know the top-sorted dependency order. For
example if you need to do something in an order where all dependencies
of a target have already previously processed.

Modifications:

added scripts/list_topsorted_dependencies.sh

Result:

can write other scripts that need top-sorted dependencies
2018-08-09 14:37:42 +01:00
Johannes Weiß a6239a9005 make contributors generator executable & change dir correctly (#403)
Motivation:

The script to generate the contributors list wasn't executable and
forgot to change to the correct directory before invoking `git`.

Modifications:

- make `scripts/generate_contributors_list.sh` executable
- correctly change directory before invoking git

Result:

it's now possible to invoke the script without explicitly running `bash`
and it's no longer important what directory one invokes the script from.
2018-05-15 10:24:32 +01:00
Damiaan Dufaux b041136b76 Update contributors.txt using shell script (#398)
Problem: contributors.txt file is out of date

Cause: it is a tedious job to edit this file manually everytime a new person contributes to the project

Solution: create a shell script that extracts all contributors from the git repository and adds it to the contributors.txt file
2018-05-11 17:48:12 +02:00
Johannes Weiß 5599bfe4c8 add useful dtrace scripts to debug allocations (#352)
Motivation:

dtrace is extrmely useful when debugging allocation related issues. This
adds two scripts that have helped me many times.

Modifications:

- `dev/malloc-aggregation.d` which prints an aggregation of all
  stacks that have allocated
- `dev/boxed-existentials.d` which live prints all allocations of boxed
  existentials

Result:

sharing debugging tools is great
2018-04-25 15:23:09 +01:00
Johannes Weiß 9360bd5c49 run integration tests in info mode (#332)
Motivation:

The integration tests' info mode lets us see the number of allocations
the did, that's great.

Modifications:

run integration tests in info mode

Result:

mode information
2018-04-18 18:32:40 +01:00
Cory Benfield 851dad09af Generate WebSocket documentation. (#276) 2018-04-04 17:45:52 +01:00
Frank Kair dbe321424d Refactors generate_linux_tests script (#236)
Motivation:

generate_linux_tests.rb is written in a non idiomatic way.

Modifications:

I used Rubocop to refactor the code.
More info: https://github.com/bbatsov/rubocop

Result:

A more idiomatic Ruby script.
2018-03-27 11:36:45 -07:00
Damiaan Dufaux a09479c0eb Turn off Jekyll for GitHub Pages (#145)
Problem: Documentation for classes like _ChannelInboundHandler are not accesible via the official API documentation pages

Cause: GitHub treats the gh-pages branch as Jekyll

Solution: Turn off Jekyll by adding a .nojekyll file to the gh-pages branch
2018-03-13 20:11:22 +01:00
Cory Benfield b542775605 Add initial websocket codec. (#109)
Motivation:

Websockets is a major protocol in use on the web today, and is
particularly valuable in applications that use asynchronous I/O
as it allows servers to keep connections open for long periods of
time for fully-duplex communication.

Users of NIO should be able to build websocket clients and servers
without too much difficulty.

Modifications:

Provided a WebsocketFrameEncoder and Decoder that can serialize and
deserialize Websocket frames.

Result:

Easier use of websockets.
2018-03-13 17:24:54 +01:00
Johannes Weiß 3cfbd075e4 improve license header checking (#131)
Motivation:

We need license headers at the top of all files but we didn't
automatically check for it in all source files.

Modifications:

Check for the full licensing header in all files (Swift, C & Shell).

Result:

If we're missing a licensing header a PR won't turn green.
2018-03-13 03:03:23 +09:00
Johannes Weiß 1065c9d38e add license headers for shell scripts (#135)
Motivation:

Our shell scripts didn't have license headers but they should.

Modifications:

Add licensing headers to all shell scripts

Result:

Licensing clear for shell scripts too.
2018-03-12 17:12:47 +00:00
tomer doron ade7eb1b37 add license headers check to sanity script (#106)
Motivation:

prevent adding source that does not include the license header

Modifications:

add a check in sanity script to grep over all swift files and make sure they have the license header

Result:

ci build will fail if/when trying to commit source files that do not include the license header
2018-03-07 18:39:21 +09:00
Cory Benfield 898c2f5882 Update test generation script to append newline character. (#70)
Motivation:

Nicely written files end in newline characters.

Modifications:

Edited the test generation script to put a newline at the end of the
LinuxMain.swift file.

Result:

One more newline
2018-03-02 17:51:20 +09:00
tomer doron 9652984b60 prepare ci scripts (#32)
Motivation:

set up continuous integration

Modifications:

* update docker file to include all dependencies required for build, unit tests, integration tests and doc generation
* remove dependency steps from doc generation script
* add integration tests driver script

Result:

able to set up docker based continuous integration
2018-02-26 11:27:53 +00:00
tomer doron 31a693fd93 fix doc generation (#8)
Motivation:

doc generation broken due to module rename and lack of tags

Modifications:

* update module names
* set default version if tag not found

Result:

doc generation works again
2018-02-22 07:57:46 +01:00
Cory Benfield 088c09ece5 Improve Linux test gen script to match current format. (#3)
Motivation:

Right now the test gen script will rewrite every file. Not ideal!

Modifications:

Added the license header, and made the follow-on comment match that
style.

Result:

Test files will look the same when running this script as they do
now.
2018-02-21 20:16:28 +01:00
Tom Doron 5f114eb3f7 fix documentation generation
motivation: bring documentation generation closer to what it will look like on oss

changes:
* make cacheable steps conditional
* use absolute path for source-kitten generated index files
2018-02-19 17:38:34 -08:00
Tom Doron 7d5dc67af8 scripts cleanup
motivation: nicer source tree

chanages:
* move scripts to scripts directory
* move integration tests to IntegrationTests directory and remove driver script
* add .sh extension to bash scripts
* adjust rio.yaml
2018-02-12 10:06:46 -08:00