Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions .circleci/config.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ jobs:
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
# On PRs we only verify the build doesn't break; arm64 under QEMU
# is ~5-8x slower and adds no signal there. Multi-arch on push/tag.
platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
build-args: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ jobs:
platforms: linux/amd64
push: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
tags: ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }}
cache-from: type=gha,scope=e2e
cache-to: type=gha,scope=e2e,mode=max
secrets: |
GIT_AUTH_TOKEN=${{ secrets.PACKAGE_SECRET }}

Expand All @@ -72,6 +74,8 @@ jobs:
platforms: linux/amd64
push: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
tags: ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }}
cache-from: type=gha,scope=e2e
cache-to: type=gha,scope=e2e,mode=max

- name: Run E2E tests
run: |
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Go test'

on:
push:
branches:
- 'master'
- 'V*'
pull_request:

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'

- name: Test
run: go test ./... -race -coverprofile=c_raw.out

- name: Filter coverage
run: grep -v generated c_raw.out | grep -v mock | grep -v test > c.out

- name: Upload coverage to Qlty
# Skip on PRs from forks: GitHub does not grant id-token: write to
# cross-repository workflow runs, so the OIDC upload cannot authenticate.
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
uses: qltysh/qlty-action/coverage@a19242102d17e497f437d7466aa01b528537e899 # v2.2.0
with:
oidc: true
files: c.out
format: coverprofile
1 change: 0 additions & 1 deletion crypto/storage/vault/vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ func TestNewVaultKVStorage(t *testing.T) {
t.Run("error - wrong URL", func(t *testing.T) {
storage, err := NewVaultKVStorage(Config{Address: "http://non-existing"})
require.Error(t, err)
assert.Regexp(t, `no such host|Temporary failure in name resolution`, err.Error())
assert.Nil(t, storage)
})
}
Expand Down
6 changes: 3 additions & 3 deletions didman/api/v1/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func TestHTTPClient_AddEndpoint(t *testing.T) {
Address: "not_an_address", Timeout: time.Second},
}
endpoint, err := c.AddEndpoint("abc", "type", "some-url")
assert.Regexp(t, `no such host|Temporary failure in name resolution`, err.Error())
assert.Error(t, err)
assert.Nil(t, endpoint)
})
}
Expand All @@ -139,7 +139,7 @@ func TestHTTPClient_DeleteEndpointsByType(t *testing.T) {
Address: "not_an_address", Timeout: time.Second},
}
err := c.DeleteEndpointsByType("did:nuts:123", "eOverdracht")
assert.Regexp(t, `no such host|Temporary failure in name resolution`, err.Error())
assert.Error(t, err)
})
}

Expand Down Expand Up @@ -228,7 +228,7 @@ func TestHTTPClient_GetCompoundServices(t *testing.T) {
Address: "not_an_address", Timeout: time.Second},
}
res, err := c.GetCompoundServices("did:nuts:123")
assert.Regexp(t, `no such host|Temporary failure in name resolution`, err.Error())
assert.Error(t, err)
assert.Nil(t, res)
})

Expand Down
14 changes: 3 additions & 11 deletions policy/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,14 @@ func (b *LocalPDP) PresentationDefinitions(_ context.Context, scope string) (pe.
return result, nil
}

// loadFromDirectory traverses all .json files in the given directory and loads them
// loadFromDirectory traverses all .json files in the given directory and loads them.
// Entries are processed in lexical order so duplicate-scope detection is deterministic.
func (b *LocalPDP) loadFromDirectory(directory string) error {
// open the directory
dir, err := os.Open(directory)
files, err := os.ReadDir(directory)
if err != nil {
return err
}
defer dir.Close()

// read all the files in the directory
files, err := dir.Readdir(0)
if err != nil {
return err
}

// load all the files
for _, file := range files {
if file.IsDir() {
continue
Expand Down
Loading