Skip to content

Commit

Permalink
Update changelog and add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
caizixian committed Nov 20, 2023
1 parent d147295 commit 7fb6db2
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Changelog
## Unreleased
### Added
#### Benchmark Suites
- `DaCapo`: add 23.11-Chopin release and minheap values.
#### Base Configurations
- DaCapo 23.11-Chopin
- Temurin 21

### Changed
#### Base Configurations
- Environment variables are expanded when resolving paths of runtimes and benchmark suites.

### Deprecated
- Deprecating Python 3.7 support for users. Python 3.7 was last released on June 6, 2023 (3.7.17), which was recent.

### Removed
- Dropping Python 3.6 support for users. Last Python 3.6 release was on Sept. 4, 2021 (3.6.15), which was long ago.
- Dropping Python 3.7 support for developers (NOT users). pytest 7.4+ requires at least Python 3.8.
- Dropping Python 3.7 support for developers (NOT users). pytest 7.4+ requires at least Python 3.8 (still supported by Ubuntu 20.04 LTS).

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions src/running/config/base/temurin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ runtimes:
type: OpenJDK
release: 17
home: /usr/lib/jvm/temurin-17-jdk-amd64
temurin-21:
type: OpenJDK
release: 21
home: /usr/lib/jvm/temurin-21-jdk-amd64
29 changes: 29 additions & 0 deletions tests/test_runtime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from running.config import Configuration


def test_openjdk_path_ennvvar():
c = Configuration(
{
"runtimes": {
"temurin-21_bogus": {
"type": "OpenJDK",
"release": 21,
# some bogus environment variable that will not be expanded
"home": "$DAHKDLHDIWHEIUWHEIWEHIJHDJKAGDKJADGUQDGIQUWDGI/temurin-21-jdk-amd64",
},
"temurin-21": {
"type": "OpenJDK",
"release": 21,
"home": "$HOME/temurin-21-jdk-amd64",
},
}
}
)

c.resolve_class()
temurin_21_bogus = c.get("runtimes")["temurin-21_bogus"]
temurin_21 = c.get("runtimes")["temurin-21_bogus"]
assert "$HOME" not in str(temurin_21.home)
assert "$DAHKDLHDIWHEIUWHEIWEHIJHDJKAGDKJADGUQDGIQUWDGI" in str(
temurin_21_bogus.home
)
30 changes: 30 additions & 0 deletions tests/test_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,33 @@ def test_dacapo_openjdk_9_workaround():
print(fop_jdk11.to_string(jdk11))
assert "add-exports" not in fop_jdk8.to_string(jdk8)
assert "add-exports" in fop_jdk11.to_string(jdk11)


def test_dacapo_path_ennvvar():
c = Configuration(
{
"suites": {
"dacapo2006_bogus": {
"type": "DaCapo",
"release": "2006",
# some bogus environment variable that will not be expanded
"path": "$DAHKDLHDIWHEIUWHEIWEHIJHDJKAGDKJADGUQDGIQUWDGI/dacapo-2006-10-MR2.jar",
"timing_iteration": 3,
},
"dacapo2006": {
"type": "DaCapo",
"release": "2006",
"path": "$HOME/dacapo-2006-10-MR2.jar",
"timing_iteration": 3,
},
}
}
)

c.resolve_class()
dacapo2006 = c.get("suites")["dacapo2006"]
dacapo2006_bogus = c.get("suites")["dacapo2006_bogus"]
assert "$HOME" not in str(dacapo2006.path)
assert "$DAHKDLHDIWHEIUWHEIWEHIJHDJKAGDKJADGUQDGIQUWDGI" in str(
dacapo2006_bogus.path
)

0 comments on commit 7fb6db2

Please sign in to comment.