Skip to content

Commit

Permalink
Merge pull request #2293 from opencb/TASK-4445
Browse files Browse the repository at this point in the history
TASK-4445 - Opencga long test fails
  • Loading branch information
j-coll authored Jul 26, 2023
2 parents 18d2cd4 + c7b53d1 commit 476848b
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 21 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/check-junit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Check junits

on:
workflow_dispatch:
inputs:
short_tests:
type: boolean
required: false
default: true
medium_tests:
type: boolean
required: false
default: false
long_tests:
type: boolean
required: false
default: false
mvn_opts:
type: string
required: false
default: ""

jobs:
get_profiles:
name: Test JUnit
runs-on: ubuntu-22.04
outputs:
profiles: ${{ steps.getter.outputs.profiles }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '10'
- name: Building string profiles to run
id: getter
run: |
if [ -f "./.github/workflows/scripts/get_profiles.sh" ]; then
chmod +x ./.github/workflows/scripts/get_profiles.sh
echo "profiles=$(./.github/workflows/scripts/get_profiles.sh ${{ inputs.short_tests }} ${{ inputs.medium_tests }} ${{ inputs.long_tests }})" >> $GITHUB_OUTPUT
fi
echo_log:
needs: get_profiles
runs-on: ubuntu-22.04
steps:
- name: Echo profiles
id: log
run: echo "Executing testing profiles -> ${{ needs.get_profiles.outputs.profiles }}"

test:
needs: [ get_profiles, echo_log ]
uses: ./.github/workflows/test-analysis.yml
with:
test_profile: ${{ needs.get_profiles.outputs.profiles }}
report_context: development
mvn_opts: ${{ inputs.mvn_opts }}
secrets: inherit
30 changes: 30 additions & 0 deletions .github/workflows/scripts/get_profiles.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

if [ $# -eq 0 ]; then
echo "The arguments must be 3"
exit 1
fi
PROFILE=""

if [ $1 == "true" ]; then
PROFILE="${PROFILE}runShortTests,"
fi
if [ $2 == "true" ]; then
PROFILE="${PROFILE}runMediumTests,"
fi
if [ $3 == "true" ]; then
PROFILE="${PROFILE}runLongTests"
fi

if [[ "${PROFILE}" == *"," ]]; then
PROFILE="${PROFILE%?}"
fi

if [ -z "${PROFILE}" ]; then
echo "There must be at least one active profile"
exit 1
fi

echo "${PROFILE}"
exit 0

8 changes: 6 additions & 2 deletions .github/workflows/test-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
report_context:
type: string
required: true
mvn_opts:
type: string
required: false
default: ""
secrets:
SONAR_TOKEN:
required: true
Expand Down Expand Up @@ -61,7 +65,7 @@ jobs:
mongodb-version: 6.0
mongodb-replica-set: rs-test
- name: Run Junit tests
run: mvn -B verify surefire-report:report -P storage-hadoop,hdp3.1,${{ inputs.test_profile }} -Dcheckstyle.skip -Popencga-storage-hadoop-deps -pl '!:opencga-storage-hadoop-deps-emr6.1,!:opencga-storage-hadoop-deps-hdp2.6'
run: mvn -B verify surefire-report:report -P storage-hadoop,hdp3.1,${{ inputs.test_profile }} -Dcheckstyle.skip -Popencga-storage-hadoop-deps -pl '!:opencga-storage-hadoop-deps-emr6.1,!:opencga-storage-hadoop-deps-hdp2.6' ${{ inputs.mvn_opts }}
- name: Upload result dir
uses: actions/upload-artifact@v3
with:
Expand All @@ -73,7 +77,7 @@ jobs:
needs: test
strategy:
matrix:
module: ["opencga-app", "opencga-catalog", "opencga-client", "opencga-clinical", "opencga-core", "opencga-master", "opencga-server", "opencga-storage", "opencga-storage/opencga-storage-app", "opencga-storage/opencga-storage-benchmark", "opencga-storage/opencga-storage-core", "opencga-storage/opencga-storage-hadoop", "opencga-storage/opencga-storage-server", "opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core", "opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-deps"]
module: [ "opencga-app", "opencga-catalog", "opencga-client", "opencga-clinical", "opencga-core", "opencga-master", "opencga-server", "opencga-storage", "opencga-storage/opencga-storage-app", "opencga-storage/opencga-storage-benchmark", "opencga-storage/opencga-storage-core", "opencga-storage/opencga-storage-hadoop", "opencga-storage/opencga-storage-server", "opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-core", "opencga-storage/opencga-storage-hadoop/opencga-storage-hadoop-deps" ]
steps:
- name: Download result dir
uses: actions/download-artifact@v3
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/test-long-test-analysis.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,6 @@ public VariantAnnotationMetadata() {
sourceVersion = new ArrayList<>();
}

public VariantAnnotationMetadata(int id, String name, Date creationDate, VariantAnnotatorProgram annotator,
List<ObjectMap> sourceVersion, DataRelease dataRelease) {

}
public VariantAnnotationMetadata(int id, String name, Date creationDate, VariantAnnotatorProgram annotator,
List<ObjectMap> sourceVersion, DataRelease dataRelease, List<String> privateSources) {
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public List<VariantAnnotation> annotate(List<Variant> variants) throws VariantAn
public ProjectMetadata.VariantAnnotationMetadata getVariantAnnotationMetadata() throws VariantAnnotatorException {
return new ProjectMetadata.VariantAnnotationMetadata(-1, null, null,
new ProjectMetadata.VariantAnnotatorProgram("MyAnnotator", key, null),
Collections.singletonList(new ObjectMap("data", "genes")), null);
Collections.singletonList(new ObjectMap("data", "genes")), null, null);
}

}

0 comments on commit 476848b

Please sign in to comment.