Skip to content

Commit

Permalink
Remove some URL calls in test code, try to update token for workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
IanCa committed Jan 31, 2024
1 parent 37133bb commit eda15ae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- name: Test with unittest
env:
HED_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
HED_GITHUB_TOKEN=${{ secrets.HED_GITHUB_TOKEN }} coverage run -m unittest
coverage run -m unittest
- name: Run spec_test coverage
run: HED_GITHUB_TOKEN=${{ secrets.HED_GITHUB_TOKEN }} coverage run --append -m unittest spec_tests/test_errors.py
env:
HED_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coverage run --append -m unittest spec_tests/test_errors.py
continue-on-error: true

- name: Archive code coverage results
Expand Down
3 changes: 0 additions & 3 deletions hed/tools/bids/bids_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
from hed.tools.bids.bids_file_group import BidsFileGroup


LIBRARY_URL_BASE = "https://raw.githubusercontent.com/hed-standard/hed-schemas/main/library_schemas/"


class BidsDataset:
""" A BIDS dataset representation primarily focused on HED evaluation.
Expand Down
10 changes: 1 addition & 9 deletions tests/tools/bids/test_bids_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,7 @@ def test_validator_types(self):
self.assertFalse(issues, "BidsDataset with participants and events validates")

def test_with_schema_group(self):
base_version = '8.2.0'
library1_url = "https://raw.githubusercontent.com/hed-standard/hed-schemas/main/" + \
"library_schemas/score/hedxml/HED_score_1.0.0.xml"
library2_url = "https://raw.githubusercontent.com/hed-standard/hed-schemas/main/" + \
"library_schemas/testlib/hedxml/HED_testlib_1.0.2.xml"
schema_list = [load_schema_version(xml_version=base_version),
load_schema(library1_url, schema_namespace="sc"),
load_schema(library2_url, schema_namespace="test")]
x = HedSchemaGroup(schema_list)
x = load_schema_version(["8.2.0", "sc:score_1.0.0", "test:testlib_1.0.2"])
bids = BidsDataset(self.library_path, schema=x, tabular_types=["participants"] )
self.assertIsInstance(bids, BidsDataset,
"BidsDataset with libraries should create a valid object from valid dataset")
Expand Down
5 changes: 2 additions & 3 deletions tests/tools/bids/test_bids_file_group.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import unittest
from hed.schema.hed_schema_io import load_schema
from hed.schema.hed_schema_io import load_schema_version
from hed.tools.analysis.tabular_summary import TabularSummary
from hed.tools.bids.bids_file_group import BidsFileGroup

Expand Down Expand Up @@ -31,8 +31,7 @@ def test_constructor(self):

def test_validator(self):
events = BidsFileGroup(self.root_path)
hed = 'https://raw.githubusercontent.com/hed-standard/hed-schemas/main/standard_schema/hedxml/HED8.0.0.xml'
hed_schema = load_schema(hed)
hed_schema = load_schema_version("8.0.0")
validation_issues = events.validate_datafiles(hed_schema, check_for_warnings=False)
self.assertFalse(validation_issues, "BidsFileGroup should have no validation errors")
validation_issues = events.validate_datafiles(hed_schema, check_for_warnings=True)
Expand Down

0 comments on commit eda15ae

Please sign in to comment.