From 9ca249d35de895cd96d9bc08a82f3957f6945e8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Thu, 25 Feb 2021 09:53:52 +0100 Subject: [PATCH] chore(tests): script to find ignored tests (#396) * chore(test): add script to find exclusive tests (fdescribe and fit) * test(e2e): run all e2e tests --- .github/workflows/main.yml | 2 ++ e2e/src/footer.e2e-spec.ts | 2 +- find-ignored-tests.sh | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100755 find-ignored-tests.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6061b4e951..9910d1b8f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,6 +22,8 @@ jobs: run: npm install - name: Build app in prod mode run: npm run build-prod + - name: Find ignored tests + run: ./find-ignored-tests.sh - name: Run unit tests run: npm run test-ci - name: Run e2e tests diff --git a/e2e/src/footer.e2e-spec.ts b/e2e/src/footer.e2e-spec.ts index e74f305f41..7632cfc978 100644 --- a/e2e/src/footer.e2e-spec.ts +++ b/e2e/src/footer.e2e-spec.ts @@ -1,7 +1,7 @@ import { browser } from 'protractor'; import { FooterPage } from './page-objects/footer.po'; -fdescribe('footer', () => { +describe('footer', () => { let footer: FooterPage; beforeEach(() => { diff --git a/find-ignored-tests.sh b/find-ignored-tests.sh new file mode 100755 index 0000000000..8af6c388ea --- /dev/null +++ b/find-ignored-tests.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +# find deactivated and exclusive tests: fdescirbe / fit / xdescribe / xit +# list=$(find . -name "*spec.ts" | xargs grep 'fit\|fdescribe\|xdescribe\|xit') + +# TODO: the following command has to be replaced with the one above +# as soon DSP-Admin is connected with DSP-VRE again + +# Find exclusive tests: fdescribe / fit +exclusive=$(find . -name "*spec.ts" | xargs grep 'fit\|fdescribe') + +# get all exclusive tests +hits=$(find . -name "*spec.ts" | xargs grep 'fit\|fdescribe' | wc -l) +if [ $hits -ne 0 ]; then + for i in "${exclusive[@]}"; do + echo "WARNING: Exclusive tests found: " + echo "$i" + done + exit 1 +fi