Skip to content

Commit

Permalink
Fix some logic found during e2e testing (#178)
Browse files Browse the repository at this point in the history
Fix CI
* parenthesis for order of operations || &&
* master, not main
  • Loading branch information
johnml1135 authored Mar 26, 2024
1 parent 29c9799 commit 293bbdf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
with:
dotnet-version: 6.0.x

- name: Check if there is a corresponding branch in Machine
- name: Check if there is a corresponding branch in Serval
id: find_matching_branch
continue-on-error: true
if: ${{ github.ref_name }} != "main"
if: ${{ github.ref_name }} != "master"
run: cd .. && git clone https://github.com/sillsdev/serval.git --branch ${{ github.ref_name }} && dotnet build machine && dotnet build serval && docker compose -f "serval/docker-compose.yml" up -d && sleep 20

- name: Get Serval and start containers
Expand All @@ -65,10 +65,10 @@ jobs:
if: ${{ failure() }}
run: docker ps -a && docker logs --since 10m serval_cntr && docker logs --since 10m echo_cntr && docker logs --since 10m machine-engine-cntr && docker logs --since 10m serval-mongo-1 && docker logs --since 10m machine-job-cntr

- name: Stop containers branch
if: (${{ success() || failure() }} && steps.find_matching_branch.outcome != 'success')
- name: Stop containers main
if: ${{ (success() || failure()) && (steps.find_matching_branch.outcome != 'success')}}
run: docker compose -f "../tmp/serval/docker-compose.yml" down

- name: Stop containers main
if: (${{ success() || failure() }} && steps.find_matching_branch.outcome == 'success')
- name: Stop containers branch
if: ${{ (success() || failure()) && (steps.find_matching_branch.outcome == 'success')}}
run: docker compose -f "../serval/docker-compose.yml" down
6 changes: 4 additions & 2 deletions src/SIL.Machine.AspNetCore/Services/NmtPreprocessBuildJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ CancellationToken cancellationToken
foreach (Corpus corpus in corpora)
{
ITextCorpus[] sourceTextCorpora = _corpusService.CreateTextCorpora(corpus.SourceFiles).ToArray();
ITextCorpus? targetTextCorpus = _corpusService.CreateTextCorpora(corpus.TargetFiles).FirstOrDefault();
if (sourceTextCorpora.Length == 0 || targetTextCorpus is null)
ITextCorpus targetTextCorpus =
_corpusService.CreateTextCorpora(corpus.TargetFiles).FirstOrDefault() ?? new DictionaryTextCorpus();

if (sourceTextCorpora.Length == 0)
continue;

int skipCount = 0;
Expand Down

0 comments on commit 293bbdf

Please sign in to comment.