Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

fix: Converts WDL log exit_code from string to int32 per WES spec #380

Merged
merged 6 commits into from
Mar 30, 2022

Conversation

OhCloud
Copy link
Contributor

@OhCloud OhCloud commented Mar 23, 2022

Issue #, if available: #314

Description of Changes

Per the wes spec AGC was incorrectly requiring a string instead of an int. This fix includes updates/returns the exit_code's string to the required int32 or "NA" for both successful/unsuccessful cases.

Description of how you validated changes

I have added additional unit tests validating a successful and unsuccessful cases. Additionally, this was validated in the terminal.
Screen Shot 2022-03-22 at 11 33 57 AM

Checklist

  • If this change would make any existing documentation invalid, I have included those updates within this PR
  • I have added unit tests that prove my fix is effective or that my feature works
  • I have linted my code before raising the PR
  • Title of this Pull Request follows Conventional Commits standard: https://www.conventionalcommits.org/en/v1.0.0/

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
d

elliot-smith
elliot-smith previously approved these changes Mar 23, 2022
s.Assert().Equal(testTaskJobId, tasks[0].JobId)
s.Assert().True(tasks[0].StartTime.Equal(testStartTime.Truncate(time.Second)))
s.Assert().True(tasks[0].StopTime.Equal(testStopTime.Truncate(time.Second)))
s.Assert().Empty(nil, "NA")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tests if nil is "empty" which it always is. Perhaps you meant to test that ExitCode is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome catch, thanks Mark! i've updated the test.

}, nil)

tasks, err := s.manager.GetWorkflowTasks(testRunId)
if s.Assert().NoError(err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the if statement as the if isn't needed but the assert is (same as the test below).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

completed.

@@ -200,6 +201,58 @@ func (s *GetWorkflowTasksTestSuite) TestGetWorkflowTasks_WithTaskNameFailure() {
}
}

func (s *GetWorkflowTasksTestSuite) TestGetWorkflowTasks_WithExitCodeUnknown() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: Please update this to "TestGetWorkflowTasks_WithExitCodeNil"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no prob.

@adamnovak
Copy link
Contributor

@markjschreiber Are you satisfied with the changes here? I want to do my revision of #317 based on top of this, since I'm going to need it for that feature to actually work, and there will be much less git surgery for me to do later if this is merged.

@OhCloud OhCloud merged commit 2b93a2c into main Mar 30, 2022
@OhCloud OhCloud deleted the ohCloud_ExitCodeConversion branch March 30, 2022 17:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants