Skip to content

Commit

Permalink
Merge branch 'develop' into TASK-6445
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Oct 22, 2024
2 parents 909426a + 3b58fb7 commit 0022507
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 69 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ jobs:
build:
uses: ./.github/workflows/build-java-app-workflow.yml

test:
uses: ./.github/workflows/test-analysis.yml
needs: build
secrets: inherit

deploy-maven:
uses: ./.github/workflows/deploy-maven-repository-workflow.yml
needs: test
needs: build
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/release-github-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
with:
name: ${{ inputs.artifact }}
- name: GitHub Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: ${{ github.ref_name }}
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/test-xetabase-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,10 @@ jobs:
path: opencga-enterprise
fetch-depth: "10"
- id: get_opencga_branch
name: Get OpenCGA branch from 'pom.xml' property
name: Get OpenCGA branch
run: |
pwd
ls -lrtha
ls -lrtha ./opencga-enterprise
chmod +x ./opencga-enterprise/.github/workflows/scripts/get-opencga-xetabase-branch.sh
opencga_branch=$(./opencga-enterprise/.github/workflows/scripts/get-opencga-xetabase-branch.sh)
opencga_branch=$(./opencga-enterprise/.github/workflows/scripts/get-opencga-xetabase-branch.sh "${{ inputs.task }}")
echo "opencga_branch=${opencga_branch}"
echo "opencga_branch=${opencga_branch}" >> $GITHUB_OUTPUT
- name: Clone OpenCGA branch '${{ steps.get_opencga_branch.outputs.opencga_branch }}'
Expand Down
48 changes: 0 additions & 48 deletions .github/workflows/tmp-test-xetabase-branch.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,13 @@ public void testAggregate() {

queryResult = mongoDBCollection.aggregate(dbObjectList, new QueryOptions(QueryOptions.LIMIT, 1).append(QueryOptions.SKIP, 0));
assertEquals("There must be 1 results", 1, queryResult.getResults().size());
assertTrue(queryResult.getResults().contains(result.get(0)));
// As the order of result list change between executions, we must ensure the assertTrue doesn't depend on the order
assertTrue(result.contains(queryResult.getResults().get(0)));

queryResult = mongoDBCollection.aggregate(dbObjectList, new QueryOptions(QueryOptions.LIMIT, 1).append(QueryOptions.SKIP, 1));
assertEquals("There must be 1 results", 1, queryResult.getResults().size());

System.out.println("result = " + result);
System.out.println("queryResult.getResults() = " + queryResult.getResults());

assertTrue(queryResult.getResults().contains(result.get(1)));
// As the order of result list change between executions, we must ensure the assertTrue doesn't depend on the order
assertTrue(result.contains(queryResult.getResults().get(0)));
}

@Test
Expand Down
7 changes: 4 additions & 3 deletions commons-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -65,8 +64,10 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.8.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
22 changes: 22 additions & 0 deletions commons-lib/src/main/java/org/opencb/commons/utils/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import org.apache.commons.lang3.StringUtils;
import org.opencb.commons.exec.Command;
import org.slf4j.LoggerFactory;

import java.io.*;
import java.nio.charset.Charset;
Expand Down Expand Up @@ -188,6 +189,27 @@ public static String[] getUserAndGroup(Path path, boolean numericId) throws IOEx
return new String[]{split[2], split[3]};
}


public static void copyFile(File src, File dest) throws IOException {
try {
org.apache.commons.io.FileUtils.copyFile(src, dest);
} catch (IOException e) {
try {
if (src.length() == dest.length()) {
LoggerFactory.getLogger(FileUtils.class).warn(e.getMessage());
return;
}
throw e;
} catch (Exception e1) {
throw e;
}
}
}

//-------------------------------------------------------------------------
// P R I V A T E M E T H O D S
//-------------------------------------------------------------------------

private static String getLsOutput(Path path, boolean numericId) throws IOException {
FileUtils.checkPath(path);

Expand Down

0 comments on commit 0022507

Please sign in to comment.