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

Ignore unformatted text blocks that are not scripts or files #552

Merged

Conversation

DavidSpickett
Copy link
Contributor

@DavidSpickett DavidSpickett commented Oct 31, 2023

While testing a learning path I had one page that used the triple backtick blocks just to show some plain text diagrams, but nothing else.

The test runner thought these were tests, but then didn't set any commands for them, as there's nothing it can do with them.

Traceback (most recent call last):
  File "./tools/maintenance.py", line 171, in <module>
    main()
  File "./tools/maintenance.py", line 148, in main
    check_lp(args.instructions, args.link, args.debug)
  File "./tools/maintenance.py", line 60, in check_lp
    res.append(check.check(lp_path + "/" + i[0], start=launch, stop=terminate))
  File "/home/davspi01/work/open_source/arm-learning-paths/tools/check.py", line 196, in check
    for j in range(0, t["ncmd"]):
KeyError: 'ncmd'

What we should do is not treat these blocks as tests at all, so that "ntests" is 0 by the time we get to check.py.

check.py is already handling "ntests" being not present or set to 0 so it all works out.

If you had a mix of triple backtick blocks, we'd skip the non-executable ones and the executable ones will still become tests and commands.

Before submitting a pull request for a new Learning Path, please review Create a Learning Path

  • I have reviewed Create a Learning Path

Please do not include any confidential information in your contribution. This includes confidential microarchitecture details and unannounced product information.

  • I have checked my contribution for confidential information

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the Creative Commons Attribution 4.0 International License.

While testing a learning path I had one page that used the
tripple backtick blocks just to show some plain text diagrams,
but nothing else.

The test runner thought these were tests, but then didn't set
any commands for them, as there's nothing it can do with them.

```
Traceback (most recent call last):
  File "./tools/maintenance.py", line 171, in <module>
    main()
  File "./tools/maintenance.py", line 148, in main
    check_lp(args.instructions, args.link, args.debug)
  File "./tools/maintenance.py", line 60, in check_lp
    res.append(check.check(lp_path + "/" + i[0], start=launch, stop=terminate))
  File "/home/davspi01/work/open_source/arm-learning-paths/tools/check.py", line 196, in check
    for j in range(0, t["ncmd"]):
KeyError: 'ncmd'
```

What we should do is not treat these blocks as tests at all,
so that "ntests" is 0 by the time we get to check.py.

check.py is already handling "ntests" being not present
or set to 0 so it all works out.

If you had a mix of triple backtick blocks, we'd skip the
non-executable ones and the executable ones will still become
tests and commands.
@DavidSpickett
Copy link
Contributor Author

I haven't run this against all the existing learning paths but I can if you can tell me how to do that.

@pareenaverma pareenaverma merged commit e3e543b into ArmDeveloperEcosystem:main Oct 31, 2023
@jasonrandrews
Copy link
Collaborator

@DavidSpickett This change causes the maintenance script to fail.
You can test with:

./tools/maintenance.py -i content/install-guides/acfl.md -d

You will need an Arm machine with Docker, Python3, and the Python packages listed in tools/requirements.txt

@DavidSpickett DavidSpickett deleted the ignore-raw-text branch November 2, 2023 08:47
@DavidSpickett
Copy link
Contributor Author

Working on a revert/alternative fix now.

@DavidSpickett
Copy link
Contributor Author

#563, apologies for the disruption.

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.

None yet

3 participants