From af65620134970a1c42a3474b6173ef3f2f09806d Mon Sep 17 00:00:00 2001 From: Wolfgang Schnerring Date: Wed, 24 Jan 2024 13:44:37 +0100 Subject: [PATCH 1/5] ZO-4519, ZO-3922: Move smoketests here from vivi-deployment --- smoketest/Pipfile | 11 + smoketest/Pipfile.lock | 549 ++++++++++++++++++++++++++++++++++++ smoketest/conftest.py | 76 +++++ smoketest/test_publisher.py | 60 ++++ 4 files changed, 696 insertions(+) create mode 100644 smoketest/Pipfile create mode 100644 smoketest/Pipfile.lock create mode 100644 smoketest/conftest.py create mode 100644 smoketest/test_publisher.py diff --git a/smoketest/Pipfile b/smoketest/Pipfile new file mode 100644 index 0000000000..e74078ace3 --- /dev/null +++ b/smoketest/Pipfile @@ -0,0 +1,11 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +"webdavclient3" = "*" +"zeit.nightwatch" = ">=1.3.2" + +[requires] +python_version = "3" diff --git a/smoketest/Pipfile.lock b/smoketest/Pipfile.lock new file mode 100644 index 0000000000..387749f4df --- /dev/null +++ b/smoketest/Pipfile.lock @@ -0,0 +1,549 @@ +{ + "_meta": { + "hash": { + "sha256": "cf8346d0d746b30665eef296521012750b8bd64dcaabf3262ae6cdd933b710f6" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "attrs": { + "hashes": [ + "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30", + "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1" + ], + "markers": "python_version >= '3.7'", + "version": "==23.2.0" + }, + "beautifulsoup4": { + "hashes": [ + "sha256:74e3d1928edc070d21748185c46e3fb33490f22f52a3addee9aee0f4f7781051", + "sha256:b80878c9f40111313e55da8ba20bdba06d8fa3969fc68304167741bbf9e082ed" + ], + "markers": "python_full_version >= '3.6.0'", + "version": "==4.12.3" + }, + "certifi": { + "hashes": [ + "sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1", + "sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474" + ], + "markers": "python_version >= '3.6'", + "version": "==2023.11.17" + }, + "charset-normalizer": { + "hashes": [ + "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027", + "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087", + "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786", + "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8", + "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09", + "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185", + "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574", + "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e", + "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519", + "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898", + "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269", + "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3", + "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f", + "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6", + "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8", + "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a", + "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73", + "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc", + "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714", + "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2", + "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc", + "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce", + "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d", + "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e", + "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6", + "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269", + "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96", + "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d", + "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a", + "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4", + "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77", + "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d", + "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0", + "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed", + "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068", + "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac", + "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25", + "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8", + "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab", + "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26", + "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2", + "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db", + "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f", + "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5", + "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99", + "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c", + "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d", + "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811", + "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa", + "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a", + "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03", + "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b", + "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04", + "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c", + "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001", + "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458", + "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389", + "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99", + "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985", + "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537", + "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238", + "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f", + "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d", + "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796", + "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a", + "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143", + "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8", + "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c", + "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5", + "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5", + "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711", + "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4", + "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6", + "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c", + "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7", + "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4", + "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b", + "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae", + "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12", + "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c", + "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae", + "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8", + "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887", + "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b", + "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4", + "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f", + "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5", + "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33", + "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519", + "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561" + ], + "markers": "python_full_version >= '3.7.0'", + "version": "==3.3.2" + }, + "cssselect": { + "hashes": [ + "sha256:666b19839cfaddb9ce9d36bfe4c969132c647b92fc9088c4e23f786b30f1b3dc", + "sha256:da1885f0c10b60c03ed5eccbb6b68d6eff248d91976fcde348f395d54c9fd35e" + ], + "markers": "python_version >= '3.7'", + "version": "==1.2.0" + }, + "greenlet": { + "hashes": [ + "sha256:01bc7ea167cf943b4c802068e178bbf70ae2e8c080467070d01bfa02f337ee67", + "sha256:0448abc479fab28b00cb472d278828b3ccca164531daab4e970a0458786055d6", + "sha256:086152f8fbc5955df88382e8a75984e2bb1c892ad2e3c80a2508954e52295257", + "sha256:098d86f528c855ead3479afe84b49242e174ed262456c342d70fc7f972bc13c4", + "sha256:149e94a2dd82d19838fe4b2259f1b6b9957d5ba1b25640d2380bea9c5df37676", + "sha256:1551a8195c0d4a68fac7a4325efac0d541b48def35feb49d803674ac32582f61", + "sha256:15d79dd26056573940fcb8c7413d84118086f2ec1a8acdfa854631084393efcc", + "sha256:1996cb9306c8595335bb157d133daf5cf9f693ef413e7673cb07e3e5871379ca", + "sha256:1a7191e42732df52cb5f39d3527217e7ab73cae2cb3694d241e18f53d84ea9a7", + "sha256:1ea188d4f49089fc6fb283845ab18a2518d279c7cd9da1065d7a84e991748728", + "sha256:1f672519db1796ca0d8753f9e78ec02355e862d0998193038c7073045899f305", + "sha256:2516a9957eed41dd8f1ec0c604f1cdc86758b587d964668b5b196a9db5bfcde6", + "sha256:2797aa5aedac23af156bbb5a6aa2cd3427ada2972c828244eb7d1b9255846379", + "sha256:2dd6e660effd852586b6a8478a1d244b8dc90ab5b1321751d2ea15deb49ed414", + "sha256:3ddc0f794e6ad661e321caa8d2f0a55ce01213c74722587256fb6566049a8b04", + "sha256:3ed7fb269f15dc662787f4119ec300ad0702fa1b19d2135a37c2c4de6fadfd4a", + "sha256:419b386f84949bf0e7c73e6032e3457b82a787c1ab4a0e43732898a761cc9dbf", + "sha256:43374442353259554ce33599da8b692d5aa96f8976d567d4badf263371fbe491", + "sha256:52f59dd9c96ad2fc0d5724107444f76eb20aaccb675bf825df6435acb7703559", + "sha256:57e8974f23e47dac22b83436bdcf23080ade568ce77df33159e019d161ce1d1e", + "sha256:5b51e85cb5ceda94e79d019ed36b35386e8c37d22f07d6a751cb659b180d5274", + "sha256:649dde7de1a5eceb258f9cb00bdf50e978c9db1b996964cd80703614c86495eb", + "sha256:64d7675ad83578e3fc149b617a444fab8efdafc9385471f868eb5ff83e446b8b", + "sha256:68834da854554926fbedd38c76e60c4a2e3198c6fbed520b106a8986445caaf9", + "sha256:6b66c9c1e7ccabad3a7d037b2bcb740122a7b17a53734b7d72a344ce39882a1b", + "sha256:70fb482fdf2c707765ab5f0b6655e9cfcf3780d8d87355a063547b41177599be", + "sha256:7170375bcc99f1a2fbd9c306f5be8764eaf3ac6b5cb968862cad4c7057756506", + "sha256:73a411ef564e0e097dbe7e866bb2dda0f027e072b04da387282b02c308807405", + "sha256:77457465d89b8263bca14759d7c1684df840b6811b2499838cc5b040a8b5b113", + "sha256:7f362975f2d179f9e26928c5b517524e89dd48530a0202570d55ad6ca5d8a56f", + "sha256:81bb9c6d52e8321f09c3d165b2a78c680506d9af285bfccbad9fb7ad5a5da3e5", + "sha256:881b7db1ebff4ba09aaaeae6aa491daeb226c8150fc20e836ad00041bcb11230", + "sha256:894393ce10ceac937e56ec00bb71c4c2f8209ad516e96033e4b3b1de270e200d", + "sha256:99bf650dc5d69546e076f413a87481ee1d2d09aaaaaca058c9251b6d8c14783f", + "sha256:9da2bd29ed9e4f15955dd1595ad7bc9320308a3b766ef7f837e23ad4b4aac31a", + "sha256:afaff6cf5200befd5cec055b07d1c0a5a06c040fe5ad148abcd11ba6ab9b114e", + "sha256:b1b5667cced97081bf57b8fa1d6bfca67814b0afd38208d52538316e9422fc61", + "sha256:b37eef18ea55f2ffd8f00ff8fe7c8d3818abd3e25fb73fae2ca3b672e333a7a6", + "sha256:b542be2440edc2d48547b5923c408cbe0fc94afb9f18741faa6ae970dbcb9b6d", + "sha256:b7dcbe92cc99f08c8dd11f930de4d99ef756c3591a5377d1d9cd7dd5e896da71", + "sha256:b7f009caad047246ed379e1c4dbcb8b020f0a390667ea74d2387be2998f58a22", + "sha256:bba5387a6975598857d86de9eac14210a49d554a77eb8261cc68b7d082f78ce2", + "sha256:c5e1536de2aad7bf62e27baf79225d0d64360d4168cf2e6becb91baf1ed074f3", + "sha256:c5ee858cfe08f34712f548c3c363e807e7186f03ad7a5039ebadb29e8c6be067", + "sha256:c9db1c18f0eaad2f804728c67d6c610778456e3e1cc4ab4bbd5eeb8e6053c6fc", + "sha256:d353cadd6083fdb056bb46ed07e4340b0869c305c8ca54ef9da3421acbdf6881", + "sha256:d46677c85c5ba00a9cb6f7a00b2bfa6f812192d2c9f7d9c4f6a55b60216712f3", + "sha256:d4d1ac74f5c0c0524e4a24335350edad7e5f03b9532da7ea4d3c54d527784f2e", + "sha256:d73a9fe764d77f87f8ec26a0c85144d6a951a6c438dfe50487df5595c6373eac", + "sha256:da70d4d51c8b306bb7a031d5cff6cc25ad253affe89b70352af5f1cb68e74b53", + "sha256:daf3cb43b7cf2ba96d614252ce1684c1bccee6b2183a01328c98d36fcd7d5cb0", + "sha256:dca1e2f3ca00b84a396bc1bce13dd21f680f035314d2379c4160c98153b2059b", + "sha256:dd4f49ae60e10adbc94b45c0b5e6a179acc1736cf7a90160b404076ee283cf83", + "sha256:e1f145462f1fa6e4a4ae3c0f782e580ce44d57c8f2c7aae1b6fa88c0b2efdb41", + "sha256:e3391d1e16e2a5a1507d83e4a8b100f4ee626e8eca43cf2cadb543de69827c4c", + "sha256:fcd2469d6a2cf298f198f0487e0a5b1a47a42ca0fa4dfd1b6862c999f018ebbf", + "sha256:fd096eb7ffef17c456cfa587523c5f92321ae02427ff955bebe9e3c63bc9f0da", + "sha256:fe754d231288e1e64323cfad462fcee8f0288654c10bdf4f603a39ed923bef33" + ], + "markers": "python_version >= '3.7'", + "version": "==3.0.3" + }, + "h11": { + "hashes": [ + "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d", + "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761" + ], + "markers": "python_version >= '3.7'", + "version": "==0.14.0" + }, + "idna": { + "hashes": [ + "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca", + "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f" + ], + "markers": "python_version >= '3.5'", + "version": "==3.6" + }, + "iniconfig": { + "hashes": [ + "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3", + "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374" + ], + "markers": "python_version >= '3.7'", + "version": "==2.0.0" + }, + "lxml": { + "hashes": [ + "sha256:13521a321a25c641b9ea127ef478b580b5ec82aa2e9fc076c86169d161798b01", + "sha256:14deca1460b4b0f6b01f1ddc9557704e8b365f55c63070463f6c18619ebf964f", + "sha256:16018f7099245157564d7148165132c70adb272fb5a17c048ba70d9cc542a1a1", + "sha256:16dd953fb719f0ffc5bc067428fc9e88f599e15723a85618c45847c96f11f431", + "sha256:19a1bc898ae9f06bccb7c3e1dfd73897ecbbd2c96afe9095a6026016e5ca97b8", + "sha256:1ad17c20e3666c035db502c78b86e58ff6b5991906e55bdbef94977700c72623", + "sha256:22b7ee4c35f374e2c20337a95502057964d7e35b996b1c667b5c65c567d2252a", + "sha256:24ef5a4631c0b6cceaf2dbca21687e29725b7c4e171f33a8f8ce23c12558ded1", + "sha256:25663d6e99659544ee8fe1b89b1a8c0aaa5e34b103fab124b17fa958c4a324a6", + "sha256:262bc5f512a66b527d026518507e78c2f9c2bd9eb5c8aeeb9f0eb43fcb69dc67", + "sha256:280f3edf15c2a967d923bcfb1f8f15337ad36f93525828b40a0f9d6c2ad24890", + "sha256:2ad3a8ce9e8a767131061a22cd28fdffa3cd2dc193f399ff7b81777f3520e372", + "sha256:2befa20a13f1a75c751f47e00929fb3433d67eb9923c2c0b364de449121f447c", + "sha256:2f37c6d7106a9d6f0708d4e164b707037b7380fcd0b04c5bd9cae1fb46a856fb", + "sha256:304128394c9c22b6569eba2a6d98392b56fbdfbad58f83ea702530be80d0f9df", + "sha256:342e95bddec3a698ac24378d61996b3ee5ba9acfeb253986002ac53c9a5f6f84", + "sha256:3aeca824b38ca78d9ee2ab82bd9883083d0492d9d17df065ba3b94e88e4d7ee6", + "sha256:3d184e0d5c918cff04cdde9dbdf9600e960161d773666958c9d7b565ccc60c45", + "sha256:3e3898ae2b58eeafedfe99e542a17859017d72d7f6a63de0f04f99c2cb125936", + "sha256:3eea6ed6e6c918e468e693c41ef07f3c3acc310b70ddd9cc72d9ef84bc9564ca", + "sha256:3f14a4fb1c1c402a22e6a341a24c1341b4a3def81b41cd354386dcb795f83897", + "sha256:436a943c2900bb98123b06437cdd30580a61340fbdb7b28aaf345a459c19046a", + "sha256:4946e7f59b7b6a9e27bef34422f645e9a368cb2be11bf1ef3cafc39a1f6ba68d", + "sha256:49a9b4af45e8b925e1cd6f3b15bbba2c81e7dba6dce170c677c9cda547411e14", + "sha256:4f8b0c78e7aac24979ef09b7f50da871c2de2def043d468c4b41f512d831e912", + "sha256:52427a7eadc98f9e62cb1368a5079ae826f94f05755d2d567d93ee1bc3ceb354", + "sha256:5e53d7e6a98b64fe54775d23a7c669763451340c3d44ad5e3a3b48a1efbdc96f", + "sha256:5fcfbebdb0c5d8d18b84118842f31965d59ee3e66996ac842e21f957eb76138c", + "sha256:601f4a75797d7a770daed8b42b97cd1bb1ba18bd51a9382077a6a247a12aa38d", + "sha256:61c5a7edbd7c695e54fca029ceb351fc45cd8860119a0f83e48be44e1c464862", + "sha256:6a2a2c724d97c1eb8cf966b16ca2915566a4904b9aad2ed9a09c748ffe14f969", + "sha256:6d48fc57e7c1e3df57be5ae8614bab6d4e7b60f65c5457915c26892c41afc59e", + "sha256:6f11b77ec0979f7e4dc5ae081325a2946f1fe424148d3945f943ceaede98adb8", + "sha256:704f5572ff473a5f897745abebc6df40f22d4133c1e0a1f124e4f2bd3330ff7e", + "sha256:725e171e0b99a66ec8605ac77fa12239dbe061482ac854d25720e2294652eeaa", + "sha256:7cfced4a069003d8913408e10ca8ed092c49a7f6cefee9bb74b6b3e860683b45", + "sha256:7ec465e6549ed97e9f1e5ed51c657c9ede767bc1c11552f7f4d022c4df4a977a", + "sha256:82bddf0e72cb2af3cbba7cec1d2fd11fda0de6be8f4492223d4a268713ef2147", + "sha256:82cd34f1081ae4ea2ede3d52f71b7be313756e99b4b5f829f89b12da552d3aa3", + "sha256:843b9c835580d52828d8f69ea4302537337a21e6b4f1ec711a52241ba4a824f3", + "sha256:877efb968c3d7eb2dad540b6cabf2f1d3c0fbf4b2d309a3c141f79c7e0061324", + "sha256:8b9f19df998761babaa7f09e6bc169294eefafd6149aaa272081cbddc7ba4ca3", + "sha256:8cf5877f7ed384dabfdcc37922c3191bf27e55b498fecece9fd5c2c7aaa34c33", + "sha256:8d2900b7f5318bc7ad8631d3d40190b95ef2aa8cc59473b73b294e4a55e9f30f", + "sha256:8d7b4beebb178e9183138f552238f7e6613162a42164233e2bda00cb3afac58f", + "sha256:8f52fe6859b9db71ee609b0c0a70fea5f1e71c3462ecf144ca800d3f434f0764", + "sha256:98f3f020a2b736566c707c8e034945c02aa94e124c24f77ca097c446f81b01f1", + "sha256:9aa543980ab1fbf1720969af1d99095a548ea42e00361e727c58a40832439114", + "sha256:9b99f564659cfa704a2dd82d0684207b1aadf7d02d33e54845f9fc78e06b7581", + "sha256:9bcf86dfc8ff3e992fed847c077bd875d9e0ba2fa25d859c3a0f0f76f07f0c8d", + "sha256:9bd0ae7cc2b85320abd5e0abad5ccee5564ed5f0cc90245d2f9a8ef330a8deae", + "sha256:9d3c0f8567ffe7502d969c2c1b809892dc793b5d0665f602aad19895f8d508da", + "sha256:9e5ac3437746189a9b4121db2a7b86056ac8786b12e88838696899328fc44bb2", + "sha256:a36c506e5f8aeb40680491d39ed94670487ce6614b9d27cabe45d94cd5d63e1e", + "sha256:a5ab722ae5a873d8dcee1f5f45ddd93c34210aed44ff2dc643b5025981908cda", + "sha256:a96f02ba1bcd330807fc060ed91d1f7a20853da6dd449e5da4b09bfcc08fdcf5", + "sha256:acb6b2f96f60f70e7f34efe0c3ea34ca63f19ca63ce90019c6cbca6b676e81fa", + "sha256:ae15347a88cf8af0949a9872b57a320d2605ae069bcdf047677318bc0bba45b1", + "sha256:af8920ce4a55ff41167ddbc20077f5698c2e710ad3353d32a07d3264f3a2021e", + "sha256:afd825e30f8d1f521713a5669b63657bcfe5980a916c95855060048b88e1adb7", + "sha256:b21b4031b53d25b0858d4e124f2f9131ffc1530431c6d1321805c90da78388d1", + "sha256:b4b68c961b5cc402cbd99cca5eb2547e46ce77260eb705f4d117fd9c3f932b95", + "sha256:b66aa6357b265670bb574f050ffceefb98549c721cf28351b748be1ef9577d93", + "sha256:b9e240ae0ba96477682aa87899d94ddec1cc7926f9df29b1dd57b39e797d5ab5", + "sha256:bc64d1b1dab08f679fb89c368f4c05693f58a9faf744c4d390d7ed1d8223869b", + "sha256:bf8443781533b8d37b295016a4b53c1494fa9a03573c09ca5104550c138d5c05", + "sha256:c26aab6ea9c54d3bed716b8851c8bfc40cb249b8e9880e250d1eddde9f709bf5", + "sha256:c3cd1fc1dc7c376c54440aeaaa0dcc803d2126732ff5c6b68ccd619f2e64be4f", + "sha256:c7257171bb8d4432fe9d6fdde4d55fdbe663a63636a17f7f9aaba9bcb3153ad7", + "sha256:d42e3a3fc18acc88b838efded0e6ec3edf3e328a58c68fbd36a7263a874906c8", + "sha256:d74fcaf87132ffc0447b3c685a9f862ffb5b43e70ea6beec2fb8057d5d2a1fea", + "sha256:d8c1d679df4361408b628f42b26a5d62bd3e9ba7f0c0e7969f925021554755aa", + "sha256:e856c1c7255c739434489ec9c8aa9cdf5179785d10ff20add308b5d673bed5cd", + "sha256:eac68f96539b32fce2c9b47eb7c25bb2582bdaf1bbb360d25f564ee9e04c542b", + "sha256:ed7326563024b6e91fef6b6c7a1a2ff0a71b97793ac33dbbcf38f6005e51ff6e", + "sha256:ed8c3d2cd329bf779b7ed38db176738f3f8be637bb395ce9629fc76f78afe3d4", + "sha256:f4c9bda132ad108b387c33fabfea47866af87f4ea6ffb79418004f0521e63204", + "sha256:f643ffd2669ffd4b5a3e9b41c909b72b2a1d5e4915da90a77e119b8d48ce867a" + ], + "markers": "python_version >= '3.6'", + "version": "==5.1.0" + }, + "mechanicalsoup": { + "hashes": [ + "sha256:38e8748f62fd9455a0818701a9e2dbfa549639d09f829f3fdd03665c825e7ce1", + "sha256:83dfc23bbbcaafb62dd43e0f12aee3202e780650b4612d999b54324558980114" + ], + "markers": "python_version >= '3.6'", + "version": "==1.3.0" + }, + "outcome": { + "hashes": [ + "sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8", + "sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b" + ], + "markers": "python_version >= '3.7'", + "version": "==1.3.0.post0" + }, + "packaging": { + "hashes": [ + "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5", + "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7" + ], + "markers": "python_version >= '3.7'", + "version": "==23.2" + }, + "playwright": { + "hashes": [ + "sha256:46d4aaed0071db67361900a2027bb14dba74f9eb102cf2baf1876c0ff0c15da6", + "sha256:925045824dc3d505c8f197c94a083e4619d7c268d7c3465d73a5a09040dc8b85", + "sha256:9ccf3214b0cdd932bcdc04794ecafe50bd386e8523ce4681969aac86d3326f87", + "sha256:9d34f472d174e55d8f12265e10d11ba21be99bf0661ccbf1f9b048312696d5e8", + "sha256:ad3ff4805fd21b91c9acbc5b27e62bf0ac6a235e93f91d9dd6d311d5e988b069", + "sha256:b56c1d564df9a2b2ab393f8161b71bcc16df38ade60115e1162ad6d9f116c89b", + "sha256:f3f0841360652ddd77f6e059074d5079dd37b487168a2972efbf13cd23fbacb0" + ], + "markers": "python_version >= '3.8'", + "version": "==1.41.0" + }, + "pluggy": { + "hashes": [ + "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12", + "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7" + ], + "markers": "python_version >= '3.8'", + "version": "==1.3.0" + }, + "prometheus-client": { + "hashes": [ + "sha256:4585b0d1223148c27a225b10dbec5ae9bc4c81a99a3fa80774fa6209935324e1", + "sha256:c88b1e6ecf6b41cd8fb5731c7ae919bf66df6ec6fafa555cd6c0e16ca169ae92" + ], + "markers": "python_version >= '3.8'", + "version": "==0.19.0" + }, + "pyee": { + "hashes": [ + "sha256:9bcc9647822234f42c228d88de63d0f9ffa881e87a87f9d36ddf5211f6ac977d", + "sha256:a642c51e3885a33ead087286e35212783a4e9b8d6514a10a5db4e57ac57b2b29" + ], + "markers": "python_version >= '3.8'", + "version": "==11.0.1" + }, + "pysocks": { + "hashes": [ + "sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299", + "sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5", + "sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0" + ], + "version": "==1.7.1" + }, + "pytest": { + "hashes": [ + "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280", + "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8" + ], + "markers": "python_version >= '3.7'", + "version": "==7.4.4" + }, + "pytest-base-url": { + "hashes": [ + "sha256:e1e88a4fd221941572ccdcf3bf6c051392d2f8b6cef3e0bc7da95abec4b5346e", + "sha256:ed36fd632c32af9f1c08f2c2835dcf42ca8fcd097d6ed44a09f253d365ad8297" + ], + "markers": "python_version >= '3.7' and python_version < '4.0'", + "version": "==2.0.0" + }, + "pytest-playwright": { + "hashes": [ + "sha256:699e2c47fbb1e6a57895454693eba278cf55d04d44c15017709b00e1de1d9ccd", + "sha256:c9ff6e7ebfd967b562f5c3d67f1ae6b45a061d6ea51ad304fdd95aca9db20774" + ], + "markers": "python_version >= '3.8'", + "version": "==0.4.3" + }, + "python-dateutil": { + "hashes": [ + "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86", + "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "version": "==2.8.2" + }, + "python-slugify": { + "hashes": [ + "sha256:70ca6ea68fe63ecc8fa4fcf00ae651fc8a5d02d93dcd12ae6d4fc7ca46c4d395", + "sha256:ce0d46ddb668b3be82f4ed5e503dbc33dd815d83e2eb6824211310d3fb172a27" + ], + "markers": "python_version >= '3.7'", + "version": "==8.0.1" + }, + "requests": { + "hashes": [ + "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", + "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" + ], + "markers": "python_version >= '3.7'", + "version": "==2.31.0" + }, + "selenium": { + "hashes": [ + "sha256:5aee79026c07985dc1b0c909f34084aa996dfe5b307602de9016d7a621a473f2", + "sha256:d43d6972e516855fb242ef9ce4ce759057b115070e702e7b1c1032fe7b38d87b" + ], + "markers": "python_version >= '3.8'", + "version": "==4.17.2" + }, + "setuptools": { + "hashes": [ + "sha256:385eb4edd9c9d5c17540511303e39a147ce2fc04bc55289c322b9e5904fe2c05", + "sha256:be1af57fc409f93647f2e8e4573a142ed38724b8cdd389706a867bb4efcf1e78" + ], + "markers": "python_version >= '3.8'", + "version": "==69.0.3" + }, + "six": { + "hashes": [ + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", + "version": "==1.16.0" + }, + "sniffio": { + "hashes": [ + "sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101", + "sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384" + ], + "markers": "python_version >= '3.7'", + "version": "==1.3.0" + }, + "sortedcontainers": { + "hashes": [ + "sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88", + "sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0" + ], + "version": "==2.4.0" + }, + "soupsieve": { + "hashes": [ + "sha256:5663d5a7b3bfaeee0bc4372e7fc48f9cff4940b3eec54a6451cc5299f1097690", + "sha256:eaa337ff55a1579b6549dc679565eac1e3d000563bcb1c8ab0d0fefbc0c2cdc7" + ], + "markers": "python_version >= '3.8'", + "version": "==2.5" + }, + "text-unidecode": { + "hashes": [ + "sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8", + "sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93" + ], + "version": "==1.3" + }, + "trio": { + "hashes": [ + "sha256:c3bd3a4e3e3025cd9a2241eae75637c43fe0b9e88b4c97b9161a55b9e54cd72c", + "sha256:ffa09a74a6bf81b84f8613909fb0beaee84757450183a7a2e0b47b455c0cac5d" + ], + "markers": "python_version >= '3.8'", + "version": "==0.24.0" + }, + "trio-websocket": { + "hashes": [ + "sha256:18c11793647703c158b1f6e62de638acada927344d534e3c7628eedcb746839f", + "sha256:520d046b0d030cf970b8b2b2e00c4c2245b3807853ecd44214acd33d74581638" + ], + "markers": "python_version >= '3.7'", + "version": "==0.11.1" + }, + "typing-extensions": { + "hashes": [ + "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783", + "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd" + ], + "markers": "python_version >= '3.8'", + "version": "==4.9.0" + }, + "urllib3": { + "extras": [ + "socks" + ], + "hashes": [ + "sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3", + "sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54" + ], + "markers": "python_version >= '3.8'", + "version": "==2.1.0" + }, + "webdavclient3": { + "hashes": [ + "sha256:bcd22586bb0d58abc26ca56054fd04228e704bd36073c3080f4597c1556c880d" + ], + "index": "pypi", + "version": "==3.14.6" + }, + "wsproto": { + "hashes": [ + "sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065", + "sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736" + ], + "markers": "python_full_version >= '3.7.0'", + "version": "==1.2.0" + }, + "zeit.nightwatch": { + "hashes": [ + "sha256:e3b65a1ef31724c0ce7f97bbb1361bb44082d074d40407748a61ba57e8aa7675" + ], + "index": "pypi", + "version": "==1.7.1" + } + }, + "develop": {} +} diff --git a/smoketest/conftest.py b/smoketest/conftest.py new file mode 100644 index 0000000000..1c9042c5ea --- /dev/null +++ b/smoketest/conftest.py @@ -0,0 +1,76 @@ +from io import BytesIO +from urllib.parse import urlparse +import xmlrpc.client + +import pytest +import webdav3.client + + +XMLRPC_AUTH = 'nightwatch:FecOdyuecl4OdAgosLong$' +CONFIG_STAGING = { + 'browser': {'baseurl': 'https://www.staging.zeit.de'}, + 'vivi': { + 'dav_url': 'http://cms-backend.staging.zeit.de:9000', + 'xmlrpc_url': f'https://{XMLRPC_AUTH}@vivi-frontend.staging.zeit.de:9090/', + }, + 'elasticsearch': 'https://tms-es.staging.zon.zeit.de/zeit_content/_search', +} + + +CONFIG_PRODUCTION = { + 'browser': {'baseurl': 'https://www.zeit.de'}, + 'vivi': { + 'dav_url': 'http://cms-backend.zeit.de:9000', + 'xmlrpc_url': f'https://{XMLRPC_AUTH}@vivi-frontend.zeit.de:9090/', + }, + 'elasticsearch': 'https://tms-es.zon.zeit.de/zeit_content/_search', +} + + +@pytest.fixture(scope='session') +def nightwatch_config(nightwatch_environment): + config = globals()['CONFIG_%s' % nightwatch_environment.upper()] + return dict(config, environment=nightwatch_environment) + + +@pytest.fixture(scope='session') +def config(nightwatch_config): # shorter spelling for our tests + return nightwatch_config + + +def pytest_configure(config): + config.option.prometheus_job_name = 'vivi-deployment-%s' % config.option.nightwatch_environment + if config.option.prometheus_extra_labels is None: + config.option.prometheus_extra_labels = [] + config.option.prometheus_extra_labels.append('project=vivi-deployment') + + +class ViviClient: + def __init__(self, dav_url, xmlrpc_url): + self.dav = webdav3.client.Client({'webdav_hostname': dav_url}) + self.xmlrpc = xmlrpc.client.ServerProxy(xmlrpc_url) + + def set_property(self, unique_id, ns, name, value): + path = '/cms/work' + urlparse(unique_id).path + if not ns.startswith('http'): + ns = 'http://namespaces.zeit.de/CMS/%s' % ns + self.dav.set_property(path, {'namespace': ns, 'name': name, 'value': value}) + + def put(self, unique_id, body): + path = '/cms/work' + urlparse(unique_id).path + self.dav.upload_to(BytesIO(body.encode('utf-8')), path) + + def refresh_dav_cache(self, unique_id): + if unique_id.startswith('/'): + unique_id = 'http://xml.zeit.de' + unique_id + self.xmlrpc.invalidate(unique_id) + + def publish(self, unique_id): + if unique_id.startswith('/'): + unique_id = 'http://xml.zeit.de' + unique_id + self.xmlrpc.publish(unique_id) + + +@pytest.fixture(scope='session') +def vivi(config): + return ViviClient(**config['vivi']) diff --git a/smoketest/test_publisher.py b/smoketest/test_publisher.py new file mode 100644 index 0000000000..b6269f9158 --- /dev/null +++ b/smoketest/test_publisher.py @@ -0,0 +1,60 @@ +from datetime import datetime, timezone +from time import sleep + +import pytest + + +def test_publisher_invalidates_fastly(vivi, http): + article = '/data/nightwatch-publish.txt' + + expected = datetime.now().isoformat() + + vivi.put(article, expected) + vivi.publish(article) + + # vivi runs the publisher asynchronously from the API call. + timeout = 60 + for i in range(timeout): + sleep(1) + r = http(article) + current = r.text.strip() + if current == expected: + break + else: + pytest.fail('Expected %s, got %s after %s seconds' % (expected, current, timeout)) + + +@pytest.mark.parametrize( + 'content', + [ + '/wirtschaft/2010-01/automarkt-usa-deutschland-smart', + '/2010/01/index', + ], +) +def test_publisher_updates_metadata(vivi, http, config, content): + before = datetime.now(timezone.utc) + sleep(1) + + vivi.publish(content) + + # vivi runs the publisher asynchronously from the API call. + timeout = 60 + for i in range(timeout): + sleep(1) + r = http( + config['elasticsearch'], + json={ + 'query': {'bool': {'filter': [{'term': {'url': content}}]}}, + '_source': ['payload.workflow.date_last_published'], + }, + ) + try: + hit = r.json()['hits']['hits'][0]['_source'] + current = hit['payload']['workflow']['date_last_published'] + current = datetime.fromisoformat(current) + except Exception: + current = datetime.min + if current > before: + break + else: + pytest.fail('%s did not increase after %s seconds' % (current, timeout)) From 6b529bbe5f4476175a704517376a2036b9553458 Mon Sep 17 00:00:00 2001 From: Wolfgang Schnerring Date: Wed, 24 Jan 2024 13:46:57 +0100 Subject: [PATCH 2/5] ZO-4519: Enable dependabot for smoketests --- .github/dependabot.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..0ef0f62544 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "MAINT:" + + - package-ecosystem: "docker" + directory: "/smoketest" + schedule: + interval: "weekly" + commit-message: + prefix: "MAINT:" + - package-ecosystem: "pip" + directory: "/smoketest" + schedule: + interval: "weekly" + commit-message: + prefix: "MAINT:" From 6fee72aa9b608f4ead9104574c80bd83c966f38b Mon Sep 17 00:00:00 2001 From: Wolfgang Schnerring Date: Wed, 24 Jan 2024 13:50:16 +0100 Subject: [PATCH 3/5] ZO-4519: Deploy nightwatch to k8s --- .github/workflows/nightwatch.yaml | 22 ++++++++++++++ bin/test | 29 +++++++++++++++++++ smoketest/.dockerignore | 1 + smoketest/Dockerfile | 9 ++++++ smoketest/k8s/base/kustomization.yaml | 11 +++++++ .../k8s/base/versions/kustomization.yaml | 6 ++++ smoketest/k8s/production/kustomization.yaml | 15 ++++++++++ smoketest/k8s/staging/kustomization.yaml | 5 ++++ 8 files changed, 98 insertions(+) create mode 100644 .github/workflows/nightwatch.yaml create mode 100755 bin/test create mode 100644 smoketest/.dockerignore create mode 100644 smoketest/Dockerfile create mode 100644 smoketest/k8s/base/kustomization.yaml create mode 100644 smoketest/k8s/base/versions/kustomization.yaml create mode 100644 smoketest/k8s/production/kustomization.yaml create mode 100644 smoketest/k8s/staging/kustomization.yaml diff --git a/.github/workflows/nightwatch.yaml b/.github/workflows/nightwatch.yaml new file mode 100644 index 0000000000..d7f341fbd5 --- /dev/null +++ b/.github/workflows/nightwatch.yaml @@ -0,0 +1,22 @@ +name: Build and deploy nightwatch tests + +on: + push: + branches: + - main + paths: + - '.github/workflows/nightwatch.yaml' + - 'smoketest/**' + pull_request: + paths: + - '.github/workflows/nightwatch.yaml' + - 'smoketest/**' + +jobs: + build: + uses: zeitonline/gh-action-workflows/.github/workflows/nightwatch-build.yaml@1.9 + secrets: inherit + with: + versions: smoketest/k8s/base/versions + + # deploy happens via flux (on `main` branch) diff --git a/bin/test b/bin/test new file mode 100755 index 0000000000..7eb8ab18b7 --- /dev/null +++ b/bin/test @@ -0,0 +1,29 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +COMMAND=$1 +case $COMMAND in + smoke) + set -e + shift + if [[ "$1" != -* ]]; then + environment=$1 + shift + else + environment="staging" + fi + + cd "$DIR/../smoketest" + + image=$(awk -F': ' '$2 == "nightwatch" { l=NR } l && NR==l+1 { print $2 }' \ + < k8s/base/kustomization.yaml) + docker buildx build --output type=docker --quiet --tag $image . + docker run --rm ${interactive} $image \ + --nightwatch-environment=$environment "$@" + ;; + *) + echo "Unrecognized command: $COMMAND" + exit 1 + ;; +esac diff --git a/smoketest/.dockerignore b/smoketest/.dockerignore new file mode 100644 index 0000000000..20bbdd68d6 --- /dev/null +++ b/smoketest/.dockerignore @@ -0,0 +1 @@ +k8s/**/* diff --git a/smoketest/Dockerfile b/smoketest/Dockerfile new file mode 100644 index 0000000000..1e38980faa --- /dev/null +++ b/smoketest/Dockerfile @@ -0,0 +1,9 @@ +# See https://github.com/ZeitOnline/gh-action-workflows/blob/main/.github/workflows/nightwatch-build.yaml +FROM python:3.12.1-slim as nightwatch +WORKDIR /app +RUN pip --no-cache-dir install pipenv +COPY Pipfile Pipfile.lock ./ +RUN pipenv sync +COPY *.py ./ +# See https://github.com/ZeitOnline/kustomize/blob/main/components/nightwatch/deployment.yaml +ENTRYPOINT ["pipenv", "run", "pytest", "--tb=native"] diff --git a/smoketest/k8s/base/kustomization.yaml b/smoketest/k8s/base/kustomization.yaml new file mode 100644 index 0000000000..246e562757 --- /dev/null +++ b/smoketest/k8s/base/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +components: +- github.com/ZeitOnline/kustomize/components/nightwatch?ref=1.3 +- versions + +# See https://github.com/ZeitOnline/gh-action-workflows/blob/main/.github/workflows/nightwatch-build.yaml +images: +- name: nightwatch + newName: europe-west3-docker.pkg.dev/zeitonline-engineering/docker-zon/vivi-nightwatch diff --git a/smoketest/k8s/base/versions/kustomization.yaml b/smoketest/k8s/base/versions/kustomization.yaml new file mode 100644 index 0000000000..f23f90e0a9 --- /dev/null +++ b/smoketest/k8s/base/versions/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1alpha1 +kind: Component + +images: +- name: nightwatch + newTag: "nothing" diff --git a/smoketest/k8s/production/kustomization.yaml b/smoketest/k8s/production/kustomization.yaml new file mode 100644 index 0000000000..a83dc9d9d3 --- /dev/null +++ b/smoketest/k8s/production/kustomization.yaml @@ -0,0 +1,15 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../base + +patches: +- target: + kind: Deployment + name: nightwatch + patch: |- + - op: replace + path: /spec/template/spec/containers/0/args + value: + - "--nightwatch-environment=production" diff --git a/smoketest/k8s/staging/kustomization.yaml b/smoketest/k8s/staging/kustomization.yaml new file mode 100644 index 0000000000..852e22250f --- /dev/null +++ b/smoketest/k8s/staging/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../base From 81f416db8900964b808021b80c90d63153c4df6b Mon Sep 17 00:00:00 2001 From: Wolfgang Schnerring Date: Wed, 24 Jan 2024 14:44:52 +0100 Subject: [PATCH 4/5] ZO-4519: Allow nightwatch access to www.staging (with IP proxy) --- .github/workflows/nightwatch.yaml | 2 ++ smoketest/k8s/staging/kustomization.yaml | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/nightwatch.yaml b/.github/workflows/nightwatch.yaml index d7f341fbd5..9c27df2afc 100644 --- a/.github/workflows/nightwatch.yaml +++ b/.github/workflows/nightwatch.yaml @@ -18,5 +18,7 @@ jobs: secrets: inherit with: versions: smoketest/k8s/base/versions + args: | + --overrides='{ "spec": { "serviceAccount": "baseproject" } }' --env="HTTPS_PROXY=http://static-ip-proxy.ops.zeit.de:3128" # deploy happens via flux (on `main` branch) diff --git a/smoketest/k8s/staging/kustomization.yaml b/smoketest/k8s/staging/kustomization.yaml index 852e22250f..b23925d084 100644 --- a/smoketest/k8s/staging/kustomization.yaml +++ b/smoketest/k8s/staging/kustomization.yaml @@ -3,3 +3,14 @@ kind: Kustomization resources: - ../base + +patches: +- target: + kind: Deployment + name: nightwatch + patch: |- + - op: add + path: /spec/template/spec/containers/0/env + value: + - name: HTTPS_PROXY + value: http://static-ip-proxy.ops.zeit.de:3128 From 817c60bbe27d79d378fbca7277887189a10c83dd Mon Sep 17 00:00:00 2001 From: Wolfgang Schnerring Date: Wed, 24 Jan 2024 15:37:55 +0100 Subject: [PATCH 5/5] ZO-4519: Retrieve credentials from vault instead of hardcoding them --- .github/workflows/nightwatch.yaml | 15 ++++++++++++++- bin/test | 21 ++++++++++++++++++--- smoketest/conftest.py | 3 ++- smoketest/k8s/base/kustomization.yaml | 14 ++++++++++++++ smoketest/k8s/staging/kustomization.yaml | 6 +++--- 5 files changed, 51 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightwatch.yaml b/.github/workflows/nightwatch.yaml index 9c27df2afc..fd356d127d 100644 --- a/.github/workflows/nightwatch.yaml +++ b/.github/workflows/nightwatch.yaml @@ -18,7 +18,20 @@ jobs: secrets: inherit with: versions: smoketest/k8s/base/versions + # copy&paste from k8s/base and k8s/staging manifest; + # the json/shell quoting is atrocious. args: | - --overrides='{ "spec": { "serviceAccount": "baseproject" } }' --env="HTTPS_PROXY=http://static-ip-proxy.ops.zeit.de:3128" + --override-type=strategic --overrides="{\"spec\": { + \"serviceAccount\": \"baseproject\", + \"containers\": [{ + \"name\": \"nightwatch-test-$TAG\", + \"env\": [ + {\"name\": \"HTTPS_PROXY\", \"value\": \"http://static-ip-proxy.ops.zeit.de:3128\"}, + {\"name\": \"VIVI_XMLRPC_PASSWORD\", \"valueFrom\": {\"secretKeyRef\": { + \"name\": \"principals\", + \"key\": \"vivi_zeit.cms.principals_system.nightwatch\" + }}} + ] + }] }}" # deploy happens via flux (on `main` branch) diff --git a/bin/test b/bin/test index 7eb8ab18b7..e507308fc9 100755 --- a/bin/test +++ b/bin/test @@ -2,6 +2,19 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +function vault_read() { + local path=$1 + local field=$2 + + if [[ -z "$VAULT_TOKEN" ]]; then + VAULT_TOKEN=$(<"$HOME/.vault-token") + fi + curl --silent -H "X-Vault-Token: $VAULT_TOKEN" \ + "${VAULT_ADDR%/}/v1/zon/v1/${path}" | \ + sed -e "s+^.*\"${field}\":\"\([^\"]*\).*$+\1+" +} + + COMMAND=$1 case $COMMAND in smoke) @@ -16,11 +29,13 @@ case $COMMAND in cd "$DIR/../smoketest" - image=$(awk -F': ' '$2 == "nightwatch" { l=NR } l && NR==l+1 { print $2 }' \ + image=$(awk -F': ' '/^ newName:/ { print $2 }' \ < k8s/base/kustomization.yaml) docker buildx build --output type=docker --quiet --tag $image . - docker run --rm ${interactive} $image \ - --nightwatch-environment=$environment "$@" + docker run --rm -it \ + -e VIVI_XMLRPC_PASSWORD=$(vault_read vivi/$environment/nightwatch password) \ + $image \ + --nightwatch-environment=$environment "$@" ;; *) echo "Unrecognized command: $COMMAND" diff --git a/smoketest/conftest.py b/smoketest/conftest.py index 1c9042c5ea..08bbd0901a 100644 --- a/smoketest/conftest.py +++ b/smoketest/conftest.py @@ -1,12 +1,13 @@ from io import BytesIO from urllib.parse import urlparse +import os import xmlrpc.client import pytest import webdav3.client -XMLRPC_AUTH = 'nightwatch:FecOdyuecl4OdAgosLong$' +XMLRPC_AUTH = 'nightwatch:' + os.environ['VIVI_XMLRPC_PASSWORD'] CONFIG_STAGING = { 'browser': {'baseurl': 'https://www.staging.zeit.de'}, 'vivi': { diff --git a/smoketest/k8s/base/kustomization.yaml b/smoketest/k8s/base/kustomization.yaml index 246e562757..d989e2846e 100644 --- a/smoketest/k8s/base/kustomization.yaml +++ b/smoketest/k8s/base/kustomization.yaml @@ -5,6 +5,20 @@ components: - github.com/ZeitOnline/kustomize/components/nightwatch?ref=1.3 - versions +patches: +- target: + kind: Deployment + name: nightwatch + patch: | + - op: add + path: /spec/template/spec/containers/0/env + value: + - name: VIVI_XMLRPC_PASSWORD + valueFrom: + secretKeyRef: + name: principals + key: vivi_zeit.cms.principals_system.nightwatch + # See https://github.com/ZeitOnline/gh-action-workflows/blob/main/.github/workflows/nightwatch-build.yaml images: - name: nightwatch diff --git a/smoketest/k8s/staging/kustomization.yaml b/smoketest/k8s/staging/kustomization.yaml index b23925d084..946ba25cfa 100644 --- a/smoketest/k8s/staging/kustomization.yaml +++ b/smoketest/k8s/staging/kustomization.yaml @@ -10,7 +10,7 @@ patches: name: nightwatch patch: |- - op: add - path: /spec/template/spec/containers/0/env + path: /spec/template/spec/containers/0/env/- value: - - name: HTTPS_PROXY - value: http://static-ip-proxy.ops.zeit.de:3128 + name: HTTPS_PROXY + value: http://static-ip-proxy.ops.zeit.de:3128