Skip to content

Commit

Permalink
Merge branch 'develop' into gh-3073-improve-test-coverage-for-gafferp…
Browse files Browse the repository at this point in the history
…opgraph
  • Loading branch information
GCHQDeveloper314 authored Nov 28, 2023
2 parents 260359b + 9d3f452 commit 7b1aaeb
Show file tree
Hide file tree
Showing 109 changed files with 2,997 additions and 1,163 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
analyse:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-legacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
env:
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v3
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
name: Check all modules are tested
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check all modules are tested
run: ./cd/check_modules.sh

build-javadoc:
name: Build Javadoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v3
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
env:
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
needs:
- build-and-run-tests
steps:
- uses: actions/checkout@v3 # Codecov need to see the src code to pair with coverage
- uses: actions/checkout@v4 # Codecov need to see the src code to pair with coverage

- name: Fetch JaCoCo reports artifact
uses: actions/download-artifact@v3
Expand All @@ -149,3 +149,4 @@ jobs:
with:
name: gaffer-coverage
fail_ci_if_error: true # Ensures upload doesn't fail silently
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/create-hotfix-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout master
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout develop
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: develop
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/link-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
issue-links:
runs-on: ubuntu-latest
steps:
- uses: tkt-actions/add-issue-links@v1.8.1
- uses: tkt-actions/add-issue-links@v1.8.2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
branch-prefix: 'gh-'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
java-version: '8'

- name: Checkout Branch
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Decode CodeSigning key
env:
Expand Down
34 changes: 8 additions & 26 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
java-version: '8'

- name: Checkout master
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand All @@ -44,10 +44,10 @@ jobs:

- name: Output branch name
id: branch
run: echo "{branch_name}={$BRANCH_NAME}" >> $GITHUB_OUTPUT
run: echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT

- name: Fail if no branch found
if: ${{ !env.BRANCH_NAME }}
- name: Fail if branch output missing (no branch found)
if: ${{ !steps.branch.outputs.branch_name }}
run: exit 1

- name: Merge release into master
Expand All @@ -69,7 +69,7 @@ jobs:

steps:
- name: Checkout develop
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: develop
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:

steps:
- name: Checkout Master
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: master

Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:

steps:
- name: Checkout Master
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
java-version: '8'

- name: Checkout release
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ needs.create-release-tag.outputs.branch_name }}

Expand All @@ -203,21 +203,3 @@ jobs:
OSS_NEXUS_USERNAME: ${{ secrets.OSS_NEXUS_USERNAME }}
OSS_NEXUS_PASSWORD: ${{ secrets.OSS_NEXUS_PASSWORD }}
run: mvn deploy -P quick,ossrh-release --settings cd/mvnsettings.xml -B

trigger-update-gafferpy-version:
runs-on: ubuntu-latest
needs:
- create-release-tag

steps:
- name: Set version
run: echo "RELEASE_VERSION=$(echo ${{ github.event.milestone.title }} | cut -c 2-)" >> $GITHUB_ENV

- name: Update gafferpy's Gaffer version
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Update Gaffer Version
repo: gchq/gafferpy
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
inputs: '{ "version": "${{ env.RELEASE_VERSION }}" }'
ref: main
2 changes: 1 addition & 1 deletion .github/workflows/update-koryphe-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

steps:
- name: Checkout branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}

Expand Down
4 changes: 2 additions & 2 deletions core/access/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2020 Crown Copyright
~ Copyright 2020-2023 Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>uk.gov.gchq.gaffer</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
18 changes: 17 additions & 1 deletion core/cache/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2017-2023 Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>core</artifactId>
<groupId>uk.gov.gchq.gaffer</groupId>
<version>2.0.1-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions core/common-util/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016-2022 Crown Copyright
~ Copyright 2016-2023 Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -20,7 +20,7 @@
<parent>
<groupId>uk.gov.gchq.gaffer</groupId>
<artifactId>core</artifactId>
<version>2.0.1-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</parent>

<artifactId>common-util</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2016-2020 Crown Copyright
* Copyright 2016-2023 Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,6 +29,7 @@ private TestPropertyNames() {
public static final String TIMESTAMP = "timestamp";
public static final String COUNT = "count";
public static final String VISIBILITY = "visibility";
public static final String NULL = "null";

public static final String PROP_1 = "property1";
public static final String PROP_2 = "property2";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2021 Crown Copyright
* Copyright 2018-2023 Crown Copyright
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,6 @@
import java.io.Closeable;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

Expand All @@ -51,8 +50,9 @@ public void shouldCacheSmallIterable(@Mock final Iterable<Integer> mockIterable)

final Iterable<Integer> cachingIterable = new CachingIterable<>(mockIterable, 5);

assertThat(SMALL_LIST).isEqualTo(Lists.newArrayList(cachingIterable));
assertThat(SMALL_LIST).isEqualTo(Lists.newArrayList(cachingIterable));
assertThat(cachingIterable)
.containsExactlyElementsOf(SMALL_LIST)
.containsExactlyElementsOf(SMALL_LIST);
verify(mockIterable, times(1)).iterator();
}

Expand All @@ -64,17 +64,17 @@ public void shouldNotCacheALargeIterable(@Mock final Iterable<Integer> mockItera

final Iterable<Integer> cachingIterable = new CachingIterable<>(mockIterable, 5);

assertThat(LARGE_LIST).isEqualTo(Lists.newArrayList(cachingIterable));
assertThat(LARGE_LIST).isEqualTo(Lists.newArrayList(cachingIterable));
assertThat(cachingIterable)
.containsExactlyElementsOf(LARGE_LIST)
.containsExactlyElementsOf(LARGE_LIST);
verify(mockIterable, times(2)).iterator();
}

@Test
public void shouldHandleNullIterable() {
Iterable<Integer> cachingIterable = new CachingIterable<>(null);

assertThat(Collections.emptyList()).isEqualTo(Lists.newArrayList(cachingIterable));
assertThat(Collections.emptyList()).isEqualTo(Lists.newArrayList(cachingIterable));
assertThat(cachingIterable).isEmpty();
}

@Test
Expand All @@ -98,7 +98,7 @@ public void shouldCloseTheIterableWhenFullyCached() throws IOException {

final Iterable<Integer> cachingIterable = new CachingIterable<>(iterable, 5);

assertThat(SMALL_LIST).isEqualTo(Lists.newArrayList(cachingIterable));
assertThat(cachingIterable).containsExactlyElementsOf(SMALL_LIST);
verify((Closeable) iterable).close();
}

Expand Down Expand Up @@ -130,15 +130,15 @@ public void shouldHandleMultipleIterators() throws IOException {
itr3.next();

final Iterator<Integer> itr4 = cachingIterable.iterator();
assertThat(SMALL_LIST).isEqualTo(Lists.newArrayList(itr4));
assertThat(Lists.newArrayList(itr4)).containsExactlyElementsOf(SMALL_LIST);

// should be cached now as it has been fully read.
verify((Closeable) iterable, times(3)).close();

itr3.next();

verify(iterable, times(4)).iterator();
assertThat(SMALL_LIST).isEqualTo(Lists.newArrayList(cachingIterable));
assertThat(cachingIterable).containsExactlyElementsOf(SMALL_LIST);

final Iterator<Integer> itr5 = cachingIterable.iterator();
assertThat(itr5.next()).isEqualTo((Integer) 0);
Expand Down
4 changes: 2 additions & 2 deletions core/data/pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016-2022 Crown Copyright
~ Copyright 2016-2023 Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -19,7 +19,7 @@
<parent>
<groupId>uk.gov.gchq.gaffer</groupId>
<artifactId>core</artifactId>
<version>2.0.1-SNAPSHOT</version>
<version>2.1.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Loading

0 comments on commit 7b1aaeb

Please sign in to comment.