Skip to content

Commit

Permalink
add call_misc_tests GH workflow (#1660)
Browse files Browse the repository at this point in the history
Also fixes a bug in the translation test bash script, where a non-zero exit code would only be returned
if the LAST .po file in the for loop had a msgcmp error.

J=SLAP-1815
TEST=manual,auto

tested using #1659
tests run in a support branch
tests fail if any of the translations in a pot file are missing, in either the last po file or a different one
short circuits if pot file is not up to date
  • Loading branch information
oshi97 committed Jan 31, 2022
1 parent 996abbc commit 8cc2b42
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ jobs:
name: Verify translation files
command: |
sudo apt-get install -qq gettext
./.circleci/run_translation_verification.sh
./.github/run_translation_verification.sh
# deploys assets to an uncached folder in the S3 bucket named by branch
deploy_branch:
docker:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ fi

# Verify that translations are present for all languages
cd conf/i18n/translations
if [[ $CIRCLE_BRANCH == release/*
|| $CIRCLE_BRANCH == hotfix/*
|| $CIRCLE_BRANCH == master
|| $CIRCLE_BRANCH == support/* ]]

exit_code=0
if [[ $GITHUB_REF_NAME == release/*
|| $GITHUB_REF_NAME == hotfix/*
|| $GITHUB_REF_NAME == master
|| $GITHUB_REF_NAME == support/* ]]
then
for po_file in *.po
do msgcmp $po_file messages.pot
do
msgcmp $po_file messages.pot || exit_code=1
done
else
echo "Skipping the verification that all translations are present"
fi
fi

exit $exit_code
4 changes: 4 additions & 0 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
call_unit_test:
uses: ./.github/workflows/unit_test.yml
needs: call_build

call_misc_tests:
uses: ./.github/workflows/miscellaneous_tests.yml

call_format_branch_name:
uses: ./.github/workflows/format_branch_name.yml
Expand All @@ -33,6 +36,7 @@ jobs:
- call_unit_test
- call_format_branch_name
- call_acceptance
- call_misc_tests
uses: ./.github/workflows/deploy.yml
with:
directory: dev/${{ needs.call_format_branch_name.outputs.formatted_branch }}
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build_and_deploy_i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
call_unit_test:
uses: ./.github/workflows/unit_test.yml
needs: call_build

call_misc_tests:
uses: ./.github/workflows/miscellaneous_tests.yml

call_format_branch_name:
uses: ./.github/workflows/format_branch_name.yml
Expand All @@ -35,6 +38,7 @@ jobs:
- call_unit_test
- call_format_branch_name
- call_acceptance
- call_misc_tests
uses: ./.github/workflows/deploy.yml
with:
directory: dev/${{ needs.call_format_branch_name.outputs.formatted_branch }}
Expand All @@ -48,6 +52,7 @@ jobs:
- call_unit_test
- call_format_branch_name
- call_acceptance
- call_misc_tests
uses: ./.github/workflows/deploy.yml
with:
directory: canary/latest
Expand All @@ -61,6 +66,7 @@ jobs:
- call_unit_test
- call_format_branch_name
- call_acceptance
- call_misc_tests
uses: ./.github/workflows/deploy.yml
with:
directory: canary/${{ github.sha }}
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/miscellaneous_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Run miscellaneous tests

on:
workflow_call:

jobs:
translation_test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- run: npm ci
- run: sudo apt-get install -qq gettext
- run: ./.github/run_translation_verification.sh

0 comments on commit 8cc2b42

Please sign in to comment.