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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ INPUT_SERVICE-URL=http://localhost:8484/
INPUT_OGC-API-PROCESSES=true

# Version of OGC API - Processes to validate against
INPUT_OGC-API-PROCESSES-VERSION=1.3-teamengine-6.0.0-RC2
INPUT_OGC-API-PROCESSES-CONTAINER-TAG=1.3-teamengine-6.0.0-RC2

# The process identifier to run for OGC API - Processes validation
INPUT_ECHOPROCESSID=echo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

- name: Lint Codebase
id: super-linter
uses: super-linter/super-linter/slim@v8
uses: super-linter/super-linter/slim@v8.2.0
env:
DEFAULT_BRANCH: main
FILTER_REGEX_EXCLUDE: dist/**/*
Expand Down
2 changes: 1 addition & 1 deletion .licenses/npm/fast-xml-parser.dep.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: fast-xml-parser
version: 4.5.3
version: 5.3.0
type: npm
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
homepage:
Expand Down
34 changes: 0 additions & 34 deletions .licenses/npm/globrex.dep.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .licenses/npm/html-escaper.dep.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .licenses/npm/strnum.dep.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: strnum
version: 1.1.2
version: 2.1.1
type: npm
summary: Parse String to Number based on configuration
homepage:
Expand Down
32 changes: 0 additions & 32 deletions .licenses/npm/test-results-parser.dep.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .licenses/npm/totalist.dep.yml

This file was deleted.

33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# OGC API Validator GitHub Action

<!-- [![GitHub Super-Linter](https://github.com/actions/typescript-action/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)
![CI](https://github.com/actions/typescript-action/actions/workflows/ci.yml/badge.svg)
[![Check dist/](https://github.com/actions/typescript-action/actions/workflows/check-dist.yml/badge.svg)](https://github.com/actions/typescript-action/actions/workflows/check-dist.yml)
[![CodeQL](https://github.com/actions/typescript-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/actions/typescript-action/actions/workflows/codeql-analysis.yml)
[![Coverage](./badges/coverage.svg)](./badges/coverage.svg) -->
[![CI](https://github.com/geo-engine/ogc-validator/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/geo-engine/ogc-validator/actions/workflows/ci.yml?branch=main)

This GitHub Action automates the process of validating an OGC API implementation
using the OGC CITE validator, e.g., OGC API Processes.
Expand All @@ -17,21 +13,32 @@ steps:
with:
service-url: https://example.com
ogc-api-processes: true
ogc-api-processes-version: 1.3-teamengine-6.0.0-RC2
ogc-api-processes-container-tag: 1.3-teamengine-6.0.0-RC2
echoprocessid: echo
ogc-api-processes-ignore: |-
foobar
```

> [!NOTE]
>
> TeamEngine is run using Podman inside the action and uses port `8080`. Ensure
> that the GitHub Actions runner has Podman installed and configured correctly.
> Moreover, the action assumes that the TeamEngine container can bind to port
> `8080`. If this port is already in use on the runner, the action will fail.
> You may need to stop other services or containers that are using this port.

### Inputs

| Name | Description | Required | Default |
| --------------------------- | -------------------------------------------------------------------------------- | -------- | -------------------------- |
| `service-url` | URL of the OGC endpoint to validate | `true` | `http://localhost:8484/` |
| `ogc-api-processes` | If set, validate OGC API - Processes | `false` | `false` |
| `ogc-api-processes-version` | Version of OGC API - Processes to validate against | `false` | `1.3-teamengine-6.0.0-RC2` |
| `echoprocessid` | The process identifier to run for OGC API - Processes validation | `false` | `echo` |
| `ogc-api-processes-ignore` | Multi-line list of test identifiers to ignore for OGC API - Processes validation | `false` | `''` |
| Name | Description | Required | Default |
| --------------------------------- | -------------------------------------------------------------------------------- | -------- | ---------------------------- |
| `service-url` | URL of the OGC endpoint to validate | `true` | `http://localhost:8484/` |
| `ogc-api-processes` | If set, validate OGC API - Processes | `false` | `false` |
| `ogc-api-processes-container-tag` | Container tag to use for OGC API - Processes 1.0 validation | `false` | `1.3-teamengine-6.0.0-RC2` |
| `echoprocessid` | The process identifier to run for OGC API - Processes validation | `false` | `echo` |
| `ogc-api-processes-ignore` | Multi-line list of test identifiers to ignore for OGC API - Processes validation | `false` | `''` |
| `ogc-api-features` | If set, validate OGC API - Features | `false` | `false` |
| `ogc-api-features-container-tag` | Container tag to use for OGC API - Features 1.0 validation | `false` | `1.1.9-teamengine-6.0.0-RC2` |
| `ogc-api-features-ignore` | Multi-line list of test identifiers to ignore for OGC API - Features validation | `false` | `''` |

## Testing with `@github/local-action`

Expand Down
25 changes: 21 additions & 4 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
import { jest } from '@jest/globals';
import * as core from '../__fixtures__/core.js';
import { waitForWebsite } from '../__fixtures__/wait.js';
import { ogcApiProcessesTestRequest } from '../src/main.js';

// Mocks should be declared before the module being tested is imported.
jest.unstable_mockModule('@actions/core', () => core);
jest.unstable_mockModule('../src/wait.js', () => ({ waitForWebsite }));

const { _validateOGCAPIProcesses } = await import('../src/main.js');
const { _validateOGCAPI } = await import('../src/main.js');

describe('main.ts', () => {
beforeEach(() => {
Expand Down Expand Up @@ -80,14 +81,30 @@ describe('main.ts', () => {
} as unknown as Response;
});

const result = await _validateOGCAPIProcesses(
const params = {
serviceUrl: mockServiceUrl,
teamenginePort: 8080,
ogcApiProcesses10: {
containerTag: 'latest',
echoProcessId: mockEchoProcessId,
testsToIgnore: mockIgnoreList,
},
};

const testRequest = ogcApiProcessesTestRequest(
mockServiceUrl,
mockEchoProcessId,
mockIgnoreList
params.ogcApiProcesses10
);

const result = await _validateOGCAPI({
testRequest,
testsToIgnore: mockIgnoreList,
xmlFilePath: '',
});

expect(result).toEqual({
name: 'OGC API - Processes',
name: 'Suite1',
success: true,
passed: 1,
skipped: 1,
Expand Down
34 changes: 22 additions & 12 deletions __tests__/params.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe('getParams', () => {

expect(params).toEqual({
serviceUrl: 'https://example.com',
teamenginePort: 8080,
});
});

Expand All @@ -36,7 +37,7 @@ describe('getParams', () => {
switch (name) {
case 'service-url':
return 'https://example.com';
case 'ogc-api-processes-version':
case 'ogc-api-processes-container-tag':
return '1.0.0';
case 'echoprocessid':
return 'echo-id';
Expand All @@ -54,10 +55,15 @@ describe('getParams', () => {

expect(params).toEqual({
serviceUrl: 'https://example.com',
ogcApiProcesses: {
ogcApiProcessesVersion: '1.0.0',
teamenginePort: 8080,
ogcApiProcesses10: {
containerTag: '1.0.0',
echoProcessId: 'echo-id',
ogcApiProcessesIgnore: ['ignore1', 'ignore2'],
testsToIgnore: ['ignore1', 'ignore2'],
},
ogcApiFeatures10: {
containerTag: '',
testsToIgnore: ['ignore1', 'ignore2'],
},
});
});
Expand All @@ -71,6 +77,7 @@ describe('printParams', () => {
it('should log parameters without ogcApiProcesses', () => {
const params = {
serviceUrl: 'https://example.com',
teamenginePort: 8080,
};

printParams(params);
Expand All @@ -79,15 +86,17 @@ describe('printParams', () => {
expect(core.info).toHaveBeenCalledWith(
'- service-url: https://example.com'
);
expect(core.info).toHaveBeenCalledWith('- teamengine-port: 8080');
});

it('should log parameters with ogcApiProcesses', () => {
const params = {
serviceUrl: 'https://example.com',
ogcApiProcesses: {
ogcApiProcessesVersion: '1.0.0',
teamenginePort: 8080,
ogcApiProcesses10: {
containerTag: '1.0.0',
echoProcessId: 'echo-id',
ogcApiProcessesIgnore: ['ignore1', 'ignore2'],
testsToIgnore: ['ignore1', 'ignore2'],
},
};

Expand All @@ -98,7 +107,7 @@ describe('printParams', () => {
'- service-url: https://example.com'
);
expect(core.info).toHaveBeenCalledWith(
'- ogc-api-processes-version: 1.0.0'
'- ogc-api-processes-container-tag: 1.0.0'
);
expect(core.info).toHaveBeenCalledWith('- echoprocessid: echo-id');
expect(core.info).toHaveBeenCalledWith(
Expand All @@ -109,10 +118,11 @@ describe('printParams', () => {
it('should log parameters with empty ogcApiProcessesIgnore', () => {
const params = {
serviceUrl: 'https://example.com',
ogcApiProcesses: {
ogcApiProcessesVersion: '1.0.0',
teamenginePort: 8080,
ogcApiProcesses10: {
containerTag: '1.0.0',
echoProcessId: 'echo-id',
ogcApiProcessesIgnore: [],
testsToIgnore: [],
},
};

Expand All @@ -123,7 +133,7 @@ describe('printParams', () => {
'- service-url: https://example.com'
);
expect(core.info).toHaveBeenCalledWith(
'- ogc-api-processes-version: 1.0.0'
'- ogc-api-processes-container-tag: 1.0.0'
);
expect(core.info).toHaveBeenCalledWith('- echoprocessid: echo-id');
expect(core.info).toHaveBeenCalledWith(
Expand Down
Loading
Loading