Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,16 @@ ci: c db-migrate
.PHONY: sanitize-pr
sanitize-pr:
./hack/bin/generate-local-nix-packages.sh
make formatf-all
make hlint-inplace-all
make formatf
make hlint-inplace-pr
make git-add-cassandra-schema
@git diff-files --quiet -- || ( echo "There are unstaged changes, please take a look, consider committing them, and try again."; exit 1 )
@git diff-index --quiet --cached HEAD -- || ( echo "There are staged changes, please take a look, consider committing them, and try again."; exit 1 )
make list-flaky-tests

list-flaky-tests:
@echo -e "\n\nif you want to run these, set RUN_FLAKY_TESTS=1\n\n"
@git grep -Hn '\bflakyTestCase \"'

.PHONY: cabal-fmt
cabal-fmt:
Expand Down Expand Up @@ -270,8 +275,9 @@ ifeq ($(INTEGRATION_FEDERATION_TESTS), 1)
$(EXE_SCHEMA) --keyspace $(package)_test2 --replication-factor 1 --reset
endif
endif
./dist/brig-index reset --elasticsearch-index directory_test --elasticsearch-server http://localhost:9200 > /dev/null
./dist/brig-index reset --elasticsearch-index directory_test2 --elasticsearch-server http://localhost:9200 > /dev/null
@echo "brig-index reset currently does not work, see https://github.com/wireapp/wire-server/pull/3114"
# ./dist/brig-index reset --elasticsearch-index directory_test --elasticsearch-server http://localhost:9200 > /dev/null
# ./dist/brig-index reset --elasticsearch-index directory_test2 --elasticsearch-server http://localhost:9200 > /dev/null

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please rebase on develop; this change should not be necessary anymore.


# Usage:
#
Expand Down
1 change: 1 addition & 0 deletions libs/types-common/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ mkDerivation {
swagger2
tagged
tasty
tasty-hunit
text
time
time-locale-compat
Expand Down
29 changes: 29 additions & 0 deletions libs/types-common/src/Test/Tasty/Pending.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
-- This file is part of the Wire Server implementation.
--
-- Copyright (C) 2023 Wire Swiss GmbH <opensource@wire.com>
--
-- This program is free software: you can redistribute it and/or modify it under
-- the terms of the GNU Affero General Public License as published by the Free
-- Software Foundation, either version 3 of the License, or (at your option) any
-- later version.
--
-- This program is distributed in the hope that it will be useful, but WITHOUT
-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-- FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
-- details.
--
-- You should have received a copy of the GNU Affero General Public License along
-- with this program. If not, see <https://www.gnu.org/licenses/>.

-- | related: https://github.com/nomeata/tasty-expected-failure
module Test.Tasty.Pending (flakyTestCase) where

import Imports
import System.IO.Unsafe (unsafePerformIO)
import Test.Tasty
import Test.Tasty.HUnit

flakyTestCase :: TestName -> Assertion -> TestTree
flakyTestCase name test = unsafePerformIO $ do
runthem <- getEnv "RUN_FLAKY_TESTS"
pure . testCase name $ when (runthem == "1") test
2 changes: 2 additions & 0 deletions libs/types-common/types-common.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ library
Data.SizedHashMap
Data.Text.Ascii
Data.UUID.Tagged
Test.Tasty.Pending
Util.Attoparsec
Util.Logging
Util.Options
Expand Down Expand Up @@ -126,6 +127,7 @@ library
, swagger2
, tagged >=0.8
, tasty >=0.11
, tasty-hunit
, text >=0.11
, time >=1.6
, time-locale-compat >=0.1
Expand Down
5 changes: 3 additions & 2 deletions services/federator/test/unit/Test/Federator/Remote.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import Test.Federator.Options (defRunSettings)
import Test.Federator.Util
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.Pending (flakyTestCase)
import Wire.API.Federation.Component
import Wire.API.Federation.Error
import Wire.Network.DNS.SRV (SrvTarget (SrvTarget))
Expand Down Expand Up @@ -101,11 +102,11 @@ testValidatesCertificateSuccess :: TestTree
testValidatesCertificateSuccess =
testGroup
"can get response with valid certificate"
[ testCase "when hostname=localhost and certificate-for=localhost" $
[ flakyTestCase "when hostname=localhost and certificate-for=localhost" $
withMockServer certForLocalhost $ \port -> do
tlsSettings <- mkTLSSettingsOrThrow settings
runCodensity (mkTestCall tlsSettings "localhost" port) assertNoRemoteError,
testCase "when hostname=localhost. and certificate-for=localhost" $
flakyTestCase "when hostname=localhost. and certificate-for=localhost" $
withMockServer certForLocalhost $ \port -> do
tlsSettings <- mkTLSSettingsOrThrow settings
runCodensity (mkTestCall tlsSettings "localhost." port) assertNoRemoteError,
Expand Down