-
Notifications
You must be signed in to change notification settings - Fork 61
Merge branch 'develop' into V13 #3447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,6 @@ run-name: Version 13.0.${{ github.run_number }} | |
|
|
||
| on: | ||
| workflow_dispatch: | ||
| schedule: | ||
| - cron: '0 2 * * *' | ||
|
|
||
| env: | ||
| TARGET_FRAMEWORK: net8 | ||
|
|
@@ -14,6 +12,16 @@ permissions: | |
| packages: read | ||
|
|
||
| jobs: | ||
| check-branch: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Validate source branch | ||
| run: | | ||
| if [ "${{ github.ref_name }}" != "V13" ]; then | ||
| echo "::error::Please call the workflow from the V13 branch" | ||
| exit 1 | ||
| fi | ||
|
||
|
|
||
| get-latest-commit-timespan: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,87 @@ | ||||||||||||||||||||||||||||||
| using System; | ||||||||||||||||||||||||||||||
| using Castle.MicroKernel.ComponentActivator; | ||||||||||||||||||||||||||||||
| using NUnit.Framework; | ||||||||||||||||||||||||||||||
| using OSPSuite.BDDHelper; | ||||||||||||||||||||||||||||||
| using OSPSuite.BDDHelper.Extensions; | ||||||||||||||||||||||||||||||
| using OSPSuite.CLI.Core.RunOptions; | ||||||||||||||||||||||||||||||
| using PKSim.CLI.Core.RunOptions; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| namespace PKSim.R | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| [IntegrationTests] | ||||||||||||||||||||||||||||||
| [Category("R")] | ||||||||||||||||||||||||||||||
| public class APISpecs : StaticContextSpecification | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| public override void GlobalContext() | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| base.GlobalContext(); | ||||||||||||||||||||||||||||||
| Api.InitializeOnce(); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| private static Exception getExceptionFromPerforming(Action work) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| try | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| work(); | ||||||||||||||||||||||||||||||
| return null; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| catch (Exception ex) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| return ex; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| protected static void ActionShouldNotThrowAn<TException>(Action workToPerform) where TException : Exception | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| Exception exceptionFromPerforming = getExceptionFromPerforming(workToPerform); | ||||||||||||||||||||||||||||||
| (exceptionFromPerforming is TException).ShouldBeFalse(); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Comment on lines
+36
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assertion helper silently passes when a different exception type is thrown. If For resolution tests, if a dependency throws 🔧 Proposed fix to fail on any exception or specifically check resolution succeededOption 1 - Fail on any exception: protected static void ActionShouldNotThrowAn<TException>(Action workToPerform) where TException : Exception
{
Exception exceptionFromPerforming = getExceptionFromPerforming(workToPerform);
- (exceptionFromPerforming is TException).ShouldBeFalse();
+ if (exceptionFromPerforming != null)
+ {
+ (exceptionFromPerforming is TException).ShouldBeFalse(
+ $"Expected no {typeof(TException).Name} but got: {exceptionFromPerforming}");
+ }
}Option 2 - If the intent is purely to test resolution, consider calling 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| public class When_resolving_tasks_after_initialization : APISpecs | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| [Observation] | ||||||||||||||||||||||||||||||
| public void can_get_individual_factory() | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| Api.GetIndividualFactory().ShouldNotBeNull(); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| [Observation] | ||||||||||||||||||||||||||||||
| public void can_get_population_factory() | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| Api.GetPopulationFactory().ShouldNotBeNull(); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| [Observation] | ||||||||||||||||||||||||||||||
| public void can_resolve_snapshot_runner() | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| ActionShouldNotThrowAn<ComponentActivatorException>(() => Api.RunSnapshot(new SnapshotRunOptions())); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| [Observation] | ||||||||||||||||||||||||||||||
| public void can_resolve_export_runner() | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| ActionShouldNotThrowAn<ComponentActivatorException>(() => Api.RunExport(new ExportRunOptions())); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| [Observation] | ||||||||||||||||||||||||||||||
| public void can_resolve_json_runner() | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| ActionShouldNotThrowAn<ComponentActivatorException>(() => Api.RunJson(new JsonRunOptions())); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| [Observation] | ||||||||||||||||||||||||||||||
| public void can_resolve_qualification_runner() | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| ActionShouldNotThrowAn<ComponentActivatorException>(() => Api.RunQualification(new QualificationRunOptions())); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| [Observation] | ||||||||||||||||||||||||||||||
| public void can_resolve_simulation_export_runner() | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| ActionShouldNotThrowAn<ComponentActivatorException>(() => Api.RunSimulationExport(new ExportRunOptions())); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yuri05 do we want these changes in V13 also? I removed the schedule for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think it's required.
As long as the workflow build-nightly_v13.yml exists only in develop and in V13 (and starting from develop is prevented by the check there) everything should be fine.