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

Functional tests #14

Merged
merged 30 commits into from
Jun 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
e9a860b
First stab at a test.
jerith Jan 22, 2017
b18a022
Handler dispatch in fake_slack.
jerith Jan 22, 2017
38f279c
Allow base_url to be set and set it in tests if we want to use our fake.
jerith Jan 22, 2017
e186647
Run tests on Travis.
jerith Jan 22, 2017
ec9f2e0
Try out a coveralls thing.
jerith Jan 22, 2017
efa0bce
Some tests for api_test and some fixes to the fake server.
jerith Jan 22, 2017
d58362d
Rearrange some things and test auth_test.
jerith Jan 28, 2017
f1d3932
Allow base url to be overridden in tests.
jerith Jan 28, 2017
fb4c794
Tests for creating and archiving channels.
jerith Jan 29, 2017
e9daa4b
All tests need to be run.
jerith Jan 29, 2017
f6bf7d7
Try fix coverage after update to ocaml-ci-scripts.
jerith Jan 29, 2017
c8c84c7
Update tests to use sessions.
jerith Feb 19, 2017
12699f0
Fix tests after rebasing in a function name change.
jerith Feb 25, 2017
fade614
Depend on newer cohttp.
jerith Apr 22, 2017
954dc9c
Rename some things.
jerith Apr 22, 2017
ac99984
Turn magic strings into constants.
jerith Apr 22, 2017
76f98fa
Fix handling of timestamps in tests.
jerith Apr 22, 2017
435a7f5
Some (skipped) tests for channels_history and lots of placeholders.
jerith Apr 22, 2017
9ea4d14
Tests for users_list.
jerith Apr 22, 2017
60a5d0b
Formatting fixes.
jerith Apr 22, 2017
7f4d9ea
Merge branch 'master' into functional-tests-3
jerith Apr 22, 2017
b8739f1
Reactivate users_list test.
jerith Apr 22, 2017
4043988
Tests for files_list.
jerith Apr 23, 2017
1e22e9e
Tests for {groups,im}.{history,list}.
jerith Apr 23, 2017
1d5642a
Merge branch 'master' into functional-tests
jerith Apr 26, 2017
6adfef5
Reactivate history tests.
jerith Apr 26, 2017
9e4d404
Merge branch 'master' into functional-tests
jerith Jun 4, 2017
092b5cf
Reactivate files_list test.
jerith Jun 4, 2017
a9b766a
Merge branch 'master' into functional-tests
jerith Jun 4, 2017
f9678e8
Reactivate bad auth tests.
jerith Jun 4, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .merlin
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
S src
S test
B _build/src
B _build/test
PKG cmdliner
PKG lwt
PKG lwt.ppx
PKG cohttp.lwt
PKG yojson
PKG ppx_deriving_yojson
PKG ppx_deriving.std
PKG oUnit
14 changes: 11 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
language: c
sudo: required
install: wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh
install:
- wget https://raw.githubusercontent.com/ocaml/ocaml-ci-scripts/master/.travis-opam.sh
- if [ -n "$COVERAGE" ]; then wget https://raw.githubusercontent.com/simonjbeaumont/ocaml-travis-coveralls/master/travis-coveralls.sh; fi
script: bash -ex .travis-opam.sh
after_success: |
if [ -n "$COVERAGE" ]; then
opam install slacko --deps-only --yes --build-test
bash -ex travis-coveralls.sh
fi
env:
global:
- PACKAGE=slacko
- EXTRA_DEPS="oasis"
- PRE_INSTALL_HOOK="oasis setup"
- TESTS=false
- TESTS=true
- COV_CONF="./configure --enable-tests"
matrix:
- OCAML_VERSION=4.02
- OCAML_VERSION=4.02 COVERAGE=YES
- OCAML_VERSION=4.03
- OCAML_VERSION=4.04
17 changes: 17 additions & 0 deletions _oasis
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ Executable "slack-notify"
NativeOpt: -safe-string
CompiledObject: best

Executable "test_slacko"
Path: test
BuildDepends: oUnit, slacko, ppx_deriving.std
MainIs: test_slacko.ml
ByteOpt: -safe-string
NativeOpt: -safe-string
CompiledObject: best
Build$: flag(tests)
Install: false

Test "test_slacko"
Run$: flag(tests)
# We need the "-runner sequential" for lwt-based tests.
# https://forge.ocamlcore.org/tracker/?func=detail&aid=1363&group_id=162&atid=730
Command: $test_slacko -runner sequential
WorkingDirectory: test

SourceRepository head
Type: git
Location: https://github.com/Leonidas-from-XIV/slacko.git
Expand Down
4 changes: 3 additions & 1 deletion opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ build: [
["ocaml" "setup.ml" "-configure" "--prefix" prefix]
["ocaml" "setup.ml" "-build"]
]
build-test: [make "test"]
install: [
["ocaml" "setup.ml" "-install"]
]
Expand All @@ -22,10 +23,11 @@ depends: [
"yojson"
"lwt" {>= "2.4.7"}
"tls" | "ssl"
"cohttp" {>= "0.13.0"}
"cohttp" {>= "0.21.1"}
"ppx_deriving_yojson" {>= "3.0"}
# for development. Not to be included in opam-repository
"oasis" {build & >= "0.4.0"}
"ounit" {test}
# /development
]
conflicts: [
Expand Down
2 changes: 1 addition & 1 deletion src/slacko.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

To use the API you first need to either apply for a {!token} from Slack,
or get one via the OAuth2 API. This string can then be converted into
a {!session} by means of {!make_session}. With this {!session} most other
a {!session} by means of {!start_session}. With this {!session} most other
methods from the binding can be called. The result of each API call is
a variant type containing either the JSON result or an error type
describing what kind of error occured.
Expand Down
Loading