-
Notifications
You must be signed in to change notification settings - Fork 243
Download PR-specified plugins in Travis-CI build #1846
Conversation
Read the updated PULL_REQUEST_TEMPLATE.md for details Possible enhancements: - Load from attached files in pull request main comment - Fix issue about GitHub API rate limit on Travis-CI - Allow more syntax flexibility when listing the plugins - Extend this feature to normal commits (but probably would never get useful)
I don't really like this idea. |
@ishitatsuyuki can you provide examples to elaborate your point? |
Sure, the win10 inventory API update is one. Also, many plugin for PM are poorly written, since it's PHP and its code quality can barely compare to a server software. |
@ishitatsuyuki although it is possible to load existing phar plugins, it is recommended that pull request authors write specific script plugins, paste them on GitHub Gist and include them in their pull requests. This allows more straightforward testing through plugins. |
I think the intention is more along the lines of adding test plugins to test certain capabilities after modifications, written purely for this purpose. Currently the CI just runs, builds, shuts down. That does not pickup anything that breaks elsewhere unless it's something very basic like a syntax error. Used correctly, this can be used to demonstrate the results of changes made in a PR. |
Not really. The real thing is if the user can receive the correct packet, not the plugins. |
Look at #1845 for example. If I make a plugin as simple as one that uses saveResource() properly, the Travis build means much more. |
I have written a simple script that can act as a proxy page according to an environment variable containing the access token: |
I don't like PHP, personally I think it's better written with shell or Python. |
@ishitatsuyuki I doubt if it is easily possible to parse the message using shell. Would probably be much more complicated. Since the whole project is in PHP and the test also uses PHP, it is natural to use PHP for parsing the PR message. |
More complicated? Most things are simpler to do from the shell, if you know the commands to use. All that overly verbose PHP curl stuff would be boiled down into a few flags from the CLI, and you can use |
@dschwartz783 that's exactly what I'm talking about. |
PHP sucks, but it doesn't matter. You've already got it installed, just use this script since it's already written. Don't even bother complaining, then you just get nothing done (end hypocrisy) |
@mhsjlw the main complaint is that this kind of stuff should be done through unit tests instead. My argument is that it is probably not good to create a unit test for everything as minor as a one-line bugfix pull request. The unit tests will stack and become unsustainable if they are used for small things like this. Unit tests are just for something different ‐ something that is probably unstable, not something that is previously wrong and now correct, where such test would only get useful for a while and is not worth being kept forever. |
Please give an argument. I think it's pointless and just making the CI longer. |
To be honest, who is really going to put the effort into writing test plugins for a one-liner? As long as a suitable, logical explanation of changes is provided, I think that would be preferable to a test plugin also written by the person making the PR. I also think this is potentially open to abuse. |
@dktapps what kind of abuse? Generate a phar from the external plugin and call a failed artifact successful? |
@SOF3 producing false test results by making it appear to be doing something it's not. Also, there's bias to consider too. How can we trust people to make a PR with test plugins that test realistic scenarios, and not just one that shows things in a favourable light? |
Uh, two opposing opinions. Thank you very much for coding, however we're going to close this. |
@dktapps because you can look at the test plugin? The test plugin is available to everyone and should be at a static (permanent and unchanged) link, such as a script plugin on GitHub Gist raw. It is not difficult to look at what is being tested at all. Also, as the pull request body above mentioned, it should be improved such that it runs the CI both with and without the plugin. @ishitatsuyuki I simply don't see what's the disadvantage of adding this. I believe the PR handlers of Genisys are not stupid enough to be fooled by a script plugin anyway, especially when such test script plugins should be as simple as possible to reflect what is being tested. |
@SOF3 You think the reviewers aren't stupid enough? I'm terribly sorry to disappoint you... it has happened many times in the past. That's why we now have such strict code reviewing standards. Some of our reviewers have been... less than stringent in the past, let's say. One of the reasons I'm considering moving my new fork outside of iTX. |
Description
This pull request changes the Travis build script. The build will download a list of plugins specified in the pull request body, and run the test server with them. The plugin list section starts with this line:
# Plugins to test with Travis-CI <!-- IGNORE THIS COMMENT - this comment is for INTERNAL use -->
Followed by a plugin list, where plugins can be specified in these formats:
If the former format is used, a file
Genisys-CI-Untitled-%d.%s
will be created, where%d
is the line number - 1 of the line that specified the plugin in the pull request body, and%s
isphp
orphar
, detected in this algorithm:The plugin list section is terminated by:
<!-- END -->
when trimmedstrlen(trim($line)) === 0
)And skips but is not terminated by other lines starting with
<!--
.Examples are present as followings:
Plugins to test with Travis-CI
Reason to modify
Travis-CI is usually useless for pull requests related to plugin API. In order to maximize the
usage of Travis-CI, this pull request allows future pull requests to validate that they work through attaching links to plugins that can test against their features. These can be instant script plugins on GitHub Gist/other pastebin sites, or preexisting plugins that are known to use a certain API feature.
Plugins can also be created to stress test the server from different approaches.
Tests & Reviews
I have tested
ciDlPlugins.php
and it works.I have not tested how the modified
.travis.yml
works on Travis-CI yet, especially when it comes to GitHub API rate limit. However, through careful manual inspection, it seems to be correct.Possible enhancements/fixes
Extend this feature to normal commits (but probably would never get useful)CI on the master branch is more useful to test the stability of the software rather than the stability of an individual commit. wontfixLoad from attached files in pull request main commentGitHub doesn't allow uploading.php
files