Skip to content

Commit

Permalink
Merge pull request #26 from kbase/sdkdev
Browse files Browse the repository at this point in the history
Move test.cfg into the root directory
  • Loading branch information
MrCreosote authored Jan 13, 2025
2 parents 3a3144f + 9f3977d commit e4f0700
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ jobs:
# set up test config
cd $HOMEDIR
# TODO TEST move to root dir
cp test_scripts/test.cfg.example test_scripts/test.cfg
sed -i "s#^test.token=.*#test.token=$KBASE_CI_TOKEN#" test_scripts/test.cfg
sed -i "s#^test.token2=.*#test.token2=$KBASE_CI_TOKEN2#" test_scripts/test.cfg
cp test.cfg.example test.cfg
sed -i "s#^test.token=.*#test.token=$KBASE_CI_TOKEN#" test.cfg
sed -i "s#^test.token2=.*#test.token2=$KBASE_CI_TOKEN2#" test.cfg
- name: Run tests
shell: bash
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ src/java/us/kbase/mobu/git.properties
/temp_test_files
/test_scripts/ee_mock_service
/lib/kbase_module_builder2.jar
/test.cfg
# old location of test.cfg
/test_scripts/test.cfg
/.coverage
/coverage.xml
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ Documentation in this readme is for developing the SDK codebase itself. If you w

## Running the tests

#### Python tests

Copy `test_scripts/test.cfg.example` to `test.cfg` and fill it in appropriately, then

```
pipenv sync --dev # only needed on the first run or when the Pipfile.lock changes
pipenv run make test-python
```
* Copy `test.cfg.example` to `test.cfg` and fill it in appropriately.
* `pipenv sync --dev`
* This only needs to be run prior to the first test run or when the Pipfile contents change.
* `pipenv run make test`

## Notes and references

Expand Down
2 changes: 1 addition & 1 deletion src/java/us/kbase/scripts/test/TestConfigHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class TestConfigHelper {
private static AuthToken token2 = null;

public static void init() throws Exception {
final Ini testini = new Ini(new File("test_scripts/test.cfg"));
final Ini testini = new Ini(new File("test.cfg"));
for (Object key: testini.get(TEST_CFG).keySet()) {
String prop = key.toString();
String value = testini.get(TEST_CFG, key);
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test_scripts/py_module_tests/test_auth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class TestAuth(unittest.TestCase):
@classmethod
def setUpClass(cls):
configfile = os.path.abspath(os.path.dirname(
os.path.abspath(__file__)) + '/../test.cfg')
os.path.abspath(__file__)) + '/../../test.cfg')
print('Loading test config from ' + configfile)
cfg = _ConfigParser()
cfg.read(configfile)
Expand Down

0 comments on commit e4f0700

Please sign in to comment.