nixosTests.wordpress: port to python#73993
Conversation
nixos/tests/wordpress.nix
Outdated
There was a problem hiding this comment.
The only thing that defers between these two commands is the service name being 1 or 2 or this directory having site{number}.
There was a problem hiding this comment.
True. something like this might be nice:
for nr in 1, 2:
machine.wait_for_unit(f"phpfpm-wordpress-site{nr}.local")
machine.succeed(
f"curl -L site{nr}.local | grep 'Welcome to the famous'",
...
)|
@GrahamcOfBorg test wordpress |
|
@aanderse I don't currently run any Wordpress instances, but feel free to add me as a maintainer of the test for the time being. Hopefully I could be of help now that it's written in language I know how to use;) |
79e9514 to
e2ddd2e
Compare
|
@mmilata I added you to the maintainers list, and also did some more refactoring to use assertions and @worldofpeace, @mmilata, PTAL. |
e2ddd2e to
069364f
Compare
|
Hm, I broke forgot a |
|
@flokli Thanks. I hope we can have more of the tests not using |
|
Umm, this test had some issue and didn't even succeed on all test cases. |
| with subtest("wordpress-init went through"): | ||
| for site_name in site_names: | ||
| info = machine.get_unit_info(f"wordpress-init-{site_name}") | ||
| assert info.Result == "success" |
There was a problem hiding this comment.
This is a dict so you'd have to do
assert info["Result"] == "success"
to not get an error.
| assert info.Result == "success" | ||
|
|
||
| with subtest("secret keys are set"): | ||
| re.compile(r"^define.*NONCE_SALT.{64,};$") |
There was a problem hiding this comment.
not sure what the r is here but you probably wanted to assign this to a variable so you could you it.
There was a problem hiding this comment.
It's raw string literal that doesn't interpret backslash escapes which is useful when working with regular expressions.
Proposed fix: #74086
Motivation for this change
#72828
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"./result/bin/)nix path-info -Sbefore and after)Notify maintainers
cc @