Commit graph

229 commits

Author SHA1 Message Date
Martin Pitt
180a48caaa Bump cockpit test/common and lib to 242
731fdf82c0 fixed the
deprecation warning in cockpit-po-plugin:

> node:37175) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning:
> Compilation.assets will be frozen in future, all modifications are
> deprecated.
> BREAKING CHANGE: No more changes should happen to Compilation.assets
> after sealing the Compilation.
2021-04-19 10:33:02 +02:00
Martin Pitt
2624dbb891 Build and ship LICENSE file
Bring back terser-webpack-plugin from commit c52136c051 and re-enable
it. It builds the autogenerated dist/index.js.LICENSE.txt which is quite
important for shipping distribution packages -- c-{podman,machines} both
do this.

Backport 95021c336e
to make sure that the webpack for the release tarball is *actually*
built in production mode.
2021-04-12 08:45:52 +02:00
Martin Pitt
a26f4048c2 packit: Enable RPM builds and Fedora testing
Teach `make dist-gzip` to print the tarball name as last line, and use
it as `create-archive` action.

Add a `make print-version` command which packit can use. The builtin
default only works if there is at least one git tag, which is not the
case for starter-kit (which is never released).
2021-03-04 11:25:53 +01:00
Martin Pitt
f02f0fd08f Move default TEST_OS to centos-8-stream
We don't run centos-7 in CI any more, and thus can't guarantee that it
works.
2021-03-04 07:43:16 +01:00
Martin Pitt
d4c81c9152 Bump cockpit test API to 239
Replace the deprecated wait_present().
2021-03-04 07:42:37 +01:00
Martin Pitt
b000d6b374 Bump cockpit component library to 238 2021-02-25 08:34:15 +01:00
Martin Pitt
bb06422996
Use Cockpit webpack helpers from cockpit.git
Drop the cockpit-po-plugin.js and sassc-loader.js code copies, and check
them out from a stable cockpit tag, similarly to how we already get the
PatternFly CSS.
2021-01-22 16:04:35 +01:00
Martin Pitt
7f6ef51c12
Build translations with webpack
Convert the `po2json` script into a webpack plugin, and integrate the
(now trivial) po.empty.js template.

This is the last step for building the entire dist/ directory with
`npm run build` (i.e. a tool that web developers are familiar with),
and not having a split webpack+make toolchain any more.
2021-01-05 14:52:59 +01:00
Martin Pitt
07017f79d8 Eliminate POTFILES.*.in files
The `find` is so cheap that there is little point in the POTFILES.*.in
indirection.
2021-01-04 14:01:59 +01:00
Martin Pitt
7fca9b9a26 webpack: Compress css in production mode
Adjust the WEBPACK_TEST file, as index.css is now not reliable (in
production mode it's .css.gz).

Closes #395
2020-11-26 11:17:04 +01:00
Martin Pitt
c1c2d83b81 Bump test/common dependency to 233
This gets rid of the hack for
<https://github.com/cockpit-project/cockpit/issues/14133>.
2020-11-25 21:09:53 +01:00
Martin Pitt
180dde395e Makefile: Fix PO template generation dependencies
*2po tools need the npm modules installed.
2020-10-29 07:23:54 +01:00
Sanne Raymaekers
3703120a23
Makefile: Bump test/common to 230
Closes #385
2020-10-28 10:15:32 +01:00
Martin Pitt
a5ade152a8 npm: Upgrade webpack related development dependencies
compression-webpack-plugin fixes https://www.npmjs.com/advisories/1548

Adjust to new copy-webpack-plugin API.

Thew new modules now create dist/index.html.gz in `NODE_ENV=production`
mode, so switch `WEBPACK_TEST` to index.css instead (which remains
uncompressed in both modes).
2020-09-28 07:49:01 +02:00
Martin Pitt
6bd2f3ed94 Makefile: Serialize git commands using flock
We previously made directories depend on files for the synthetic
serialization of git commands. git does not track directories, and
time stamps across repos (starter-kit vs. bots) work rather poorly --
for example, this broke "bots" being a symlink to a previously existing
checkout.

Use file locking instead, which is a more direct way of ensuring that
there is only one git operation that affects the current checkout. We
don't need to flock bots/, as that's an independent git repository.

Closes #371
2020-09-22 08:50:54 +02:00
Martin Pitt
661ca771b3
Makefile: Replace git restore command
This is a relatively recent git feature which is not present in e.g.
Debian 9 yet. Use `git reset` instead, like in the test/common rule.

Fixes #369
Closes #370
2020-09-22 07:51:54 +02:00
Matej Marusak
d7f9b03f3a
test: Bump test/common to 228
On the login page the `Reuse password` checkbox was dropped and that
makes all the tests to fail.
See ef97e7e9a2

Closes #366
2020-09-21 12:19:25 +02:00
Martin Pitt
cfced19000 Makefile: Serialize git cloning targets
The `bots`, `test/common`, and `src/lib/patternfly` targets cannot be
run in parallel, as they compete for the git lock.

Serialize them by adding arbitrary dependencies to them.
2020-09-08 17:14:34 +02:00
Katerina Koukiou
203604a463 Copy patternfly import files from cockpit project automatically
Closes #357
2020-09-08 17:14:34 +02:00
Martin Pitt
fc4333b50e Makefile: Don't hardcode starter-kit in variable 2020-08-05 13:45:57 +02:00
Martin Pitt
cd778dbe12 Bump Cockpit test API to 224 2020-08-05 13:45:57 +02:00
Martin Pitt
4166f0a5d4 Use cockpit 220's test runner
This will format the test output as TAP and thus provide nice log.html
output.

Closes #320
2020-05-28 10:52:41 +02:00
Matej Marusak
8adad16874
Bump up version of test/common
There has been a lot of improvements since 213 and also due to new
privilege escalation this is need.

Closes #317
2020-05-23 07:51:00 +02:00
Martin Pitt
115e5a885f Makefile: Use proper file dependencies
Avoid phony dependencies, as they break timestamp comparison and thus
always cause rebuilding of the tarball, rpm, and (the very expensive) VM
for each `make check`, even if only the tests (or nothing at all)
changed.

Use `rpmspec` to predict the name of the built rpm. Use the .spec.in
file directly, as we can't depend on the generated .spec file in the
variable definition.

Closes #290
2020-03-10 11:49:29 +01:00
Martin Pitt
38bd17faef Make cockpit-starter-kit.spec.in rpmspec compliant
Use `%{VERSION}` as version macro instead of `@VERSION@`, so that the
.spec.in file is syntactically a correct spec file that can be parsed
with `rpmspec`.
2020-03-10 11:49:29 +01:00
Martin Pitt
b0bf8afa48 test: Trim package installation
We don't need the full cockpit metapackage with cockpit-docker, etc.
The starter-kit RPM will already pull in cockpit-system, so we just need
cockpit-ws.
2020-03-10 11:49:29 +01:00
Martin Pitt
696ef20f32 Bump cockpit test API to 213 2020-03-10 11:49:29 +01:00
Matej Marušák
c550689296
Bump version of test API
Closes #256
2019-12-12 19:57:24 +01:00
Martin Pitt
bd0fea40f2 Support CI testing against a bots project PR
* If `$COCKPIT_BOTS_REF` is set, check out that bots version instead of
   master.

 * Use git cache in $XDG_CACHE_HOME if available. Our CI uses that to
   save downloads, and it does not get in the way for local developers.

 * Stop making "bots" a phony target, and drop the now unnecessary
   `[ -d bots ]` check.

Closes #233
2019-10-02 14:31:36 +02:00
Martin Pitt
d43845c1a3 Makefile: Don't clobber an existing bots checkout
Commit 95b2aff0 was a thinko -- for our CI we *don't* want our test to
clobber a pre-existing bots/ checkout, as we often use this to run tests
against an updated image or to validate a changes to the bots project.

On developer machines, bots may also be a symlink to an actual bots
directory in development, so don't clobber that.

Closes #232
2019-10-01 23:00:07 +02:00
Martin Pitt
24311984e8 Makefile: Fix image-customize call for multiple rpms
Ensure that we only install the current rpm into the VM. If there are
older ones in the build tree, image-customize otherwise fails.
2019-09-30 06:12:07 +02:00
Martin Pitt
95b2aff0b8 Makefile: Update bots target for moved GitHub project
Cockpit bots are in their own project now.

Make the target phony so that `make bots` updates an existing checkout.

Closes #228
2019-09-23 17:28:30 +02:00
Martin Pitt
0d636daa47 Fix building under NODE_ENV=production
This is meant to only control webpack. But `npm install` skips
installing `devDependencies` under `NODE_ENV=production`, which breaks
the package build. So always unset it for npm.

This fixes `NODE_ENV=production make` in a clean tree.
2019-09-12 12:53:09 +02:00
Martin Pitt
0afad278eb Fix updating of node_modules/
`npm install` does not update/touch an already existing
package-lock.json. Thus after

    make
    touch package.json
    make

a subsequent `make` would still run `npm install`. To fix this, remove
package-lock.json before `npm install`, so that (1) package-lock.json
always gets touched and thus the make rule actually works, and (2)
during development we always get up to date packages (we only really
want the "locking" behaviour for building from release tarballs).

Also run `npm prune` so that switching between git trees with
added/removed modules works correctly.

Closes #223
2019-09-12 12:53:09 +02:00
Martin Pitt
bfc4039b3e
Use and ship package-lock.json
npm install has been generating package-lock.json [1] for long enough
for us to start relying on it.

Replace the unreliable and hacky `$NODE_MODULES_TEST` file with just
comparing package.json against package-lock.json to decide when to run
npm install. This will finally avoid unnecessary `npm install` runs, but
start to run these when git switching branches that have a different
package.json.

Ship package-lock.json in release tarballs, so that node_modules/ can be
reconstructed exactly as it was when making the release.

[1] https://docs.npmjs.com/files/package-lock.json

Closes #222
2019-09-12 10:47:58 +02:00
Martin Pitt
25b970ec6b Bump cockpit test API to 202 2019-09-11 09:37:56 +02:00
Martin Pitt
1fc1923021 Rename *.es6 to *.js
*.es6 isn't standard naming, that was just an old cockpit-ism. All files
are treated as ES6.
2019-07-17 17:43:01 +02:00
Martin Pitt
989e8c9301 Bump Cockpit test API to 195
No API changes.

Closes #181
2019-06-05 08:23:52 +02:00
Martin Pitt
fa7a430847 test: Remove redundant wait_present() calls (#159)
These are obsolete since
b1722f5b5d

Bump cockpit test API accordingly.

Closes #159
2019-04-03 16:59:13 +02:00
Martin Pitt
d3c41370c9 Bump Cockpit test API to 190
No API changes.

Closes #158
2019-04-03 11:36:31 +02:00
Martin Pitt
e9db4448c9 Bump Cockpit test API to 187
No API changes.

Closes #103
2019-02-13 12:22:46 +01:00
Kyrylo Gliebov
1dd8711512 Add app-data-validate for metainfo.xml
Closes #82
2019-02-06 10:20:19 +01:00
Martin Pitt
891480366c
Bump Cockpit test API to 185
No API changes.

Closes #89
2019-01-29 11:54:51 +01:00
bmustiata
81096b95ca Support watching for changing code
Closes #93
2019-01-28 14:22:45 +01:00
Martin Pitt
bb541d7506
Bump Cockpit test API to 181
No API changes.

Closes #52
2018-11-08 13:47:06 +01:00
Martin Pitt
1da6473420 test: Really clean up test VM on image preparation
The previous fix (commit 6e05f5b483) only cleaned
test/images/$(TEST_OS), which is just a symlink to $(TEST_OS).qcow.
Clean the actual image as well.

Closes #46
2018-09-06 16:51:42 +02:00
Martin Pitt
6e05f5b483 test: Properly clean up test VM on image preparation
Remove the entire previous overlay instead of just removing the built
package. This ensures that there are no leftovers from previous
interactive debugging sessions.

This has already shown to lead to confusion in practice in
cockpit-podman.

Closes #44
2018-08-29 14:14:54 +02:00
Martin Pitt
fd59f8629b Fix make rpm for unreleased code
When the topmost commit isn't tagged, rpmbuild otherwise fails with

    error: line 2: Illegal char '-' (0x2d) in: Version: 176-1-g9101a30a

Replace the dashes from `git describe` with periods, to get a valid RPM
upstream version number.

Closes #45
2018-08-29 14:03:19 +02:00
Martin Pitt
b0fd338e4b Bump Cockpit test API to 176
No API changes.
2018-08-28 22:51:10 +02:00
Martin Pitt
959d743452 Drop Python3 build requirement
This is only being used for extracting the package name from package
json, to avoid having to duplicate it in `Makefile`.
But for only this purpose, Python 3 is rather heavyweight. It's also not
available on RHEL/CentOS 7.
2018-08-28 22:51:10 +02:00