-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2801 from vkarak/feat/userlib-imports
[feat] Simplify custom user imports in tests
- Loading branch information
Showing
9 changed files
with
204 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def greetings(name): | ||
return f'Hello, {name}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import reframe as rfm | ||
import reframe.utility as util | ||
import reframe.utility.sanity as sn | ||
from testutil import greetings_from_test | ||
|
||
commonutil = util.import_module('..commonutil') | ||
|
||
|
||
@rfm.simple_test | ||
class MyTest(rfm.RunOnlyRegressionTest): | ||
valid_systems = ['*'] | ||
valid_prog_environs = ['*'] | ||
executable = f'echo {commonutil.greetings("friends")}' | ||
|
||
@sanity_function | ||
def validate(self): | ||
return sn.assert_found('Hello, friends', self.stdout) | ||
|
||
|
||
@rfm.simple_test | ||
class MyTest2(MyTest): | ||
@run_before('run') | ||
def set_exec(self): | ||
self.executable = f'echo {greetings_from_test(self)}' | ||
|
||
@sanity_function | ||
def validate(self): | ||
return sn.assert_found(f'Hello from {self.name}', self.stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def greetings_from_test(test): | ||
return f'Hello from {test.name}' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters