Skip to content
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

Remove cylc submit and cylc jobscript #3653

Merged
merged 3 commits into from
Jun 12, 2020

Conversation

datamel
Copy link
Contributor

@datamel datamel commented Jun 11, 2020

This PR also involves rewriting some functional tests as unit tests.

Note, I have not removed all of the functional tests in the jobscript directory. I believe the ones I have left are useful functional tests that test jobscript and are more suited to functional tests than unit tests.

The functional tests removed have been replaced by unit tests, with the exception of tests/jobscript/01-multi.t - this currently relies on cylc jobscript command and is not suited to unit testing. This is testing that namespace_hierarchy is correctly populated and is covered by other tests.

These changes relate to #1249

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Appropriate tests are included (unit and/or functional).
  • Appropriate change log entry included.
  • I will open a documentation PR at cylc/cylc-doc

datamel added 2 commits June 11, 2020 17:23
Convert Jobscript Functional Tests to Unit Tests
@datamel datamel added this to the cylc-8.0a3 milestone Jun 11, 2020
@datamel datamel requested a review from oliver-sanders June 11, 2020 17:01
@datamel datamel self-assigned this Jun 11, 2020
Copy link
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

Quick skim, looks good.

cylc/flow/scripts/cylc.py Show resolved Hide resolved
Comment on lines +98 to +101
assert (os.path.exists(local_job_file_path))
size_of_file = os.stat(local_job_file_path).st_size
print(size_of_file)
assert(size_of_file == 1715)
Copy link
Member

Choose a reason for hiding this comment

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

That's a somewhat strange way to test it!

This is effectively a "known good output" test, so we could just include the "good output", that way when the test breaks you get a diff.

@oliver-sanders oliver-sanders requested a review from kinow June 11, 2020 17:19
Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

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

Looks good to me. Impressive work @datamel, to go through all these tests, and update some to unit tests! 👏

Later I think we also need to update the cylc-docs? e.g. https://github.com/cylc/cylc-doc/blob/06beda801367437072cc485a9262efda678f991a/src/user-guide/task-job-submission.rst#task-job-submission-and-management & https://github.com/cylc/cylc-doc/blob/06beda801367437072cc485a9262efda678f991a/src/user-guide/task-implementation.rst#task-job-scripts ? (EDIT: just saw your comment in the pull request issue template, ignore that :-) )

@oliver-sanders
Copy link
Member

Later I think we also need to update the cylc-docs?

The CLI docs are probably a bit out-of-wack, once we've got the CLI properly implemented we will auto-document the CLI.

@oliver-sanders oliver-sanders merged commit 007cdfc into cylc:master Jun 12, 2020
@hjoliver
Copy link
Member

hjoliver commented Jun 12, 2020

@kinow 's links above do point at references to cylc jobscript in the User Guide text, so it's not just the "CLI docs" (if by that you mean the the auto-generated command help docs).

@oliver-sanders
Copy link
Member

True, though there is something we can do to automate this.

We now write cylc configurations in this syntax:

You can change this with :cylc:conf:`suite.rc[scheduling]max active cycle points`.

If we renamed or removed max active cycle points then the docs would fail to build due to a broken reference. We can do the same thing with commands:

You can see what the job script looks like using the :command:`cylc jobscript` command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants