Commit graph

260 commits

Author SHA1 Message Date
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
Martin Pitt
0a7a0bfb59 Fix Makefile dependencies for directories in src/
Our release tarballs only contain files, not their containing
directories, due to `git ls-files`. tar creates these directories on the
fly on unpack, with a current timestamp instead of an archived one. This
causes directories in src/ to be newer than dist/ and thus a `make` will
try to rebuild the webpack. This breaks RPM builds.
2018-07-19 09:11:07 +02:00
Martin Pitt
e9635620c5 spec: Don't try to rebuild webpack when building released tarballs
Release tarballs already have dist/. We can't rebuild the webpack in an
RPM as that requires npm and network access for `npm install`. But we
also don't want to ship the entire `node_modules/` as that is huge and
would require lots of careful license review.

So ship a stub node_modules/ that satisfies the Makefile dependency.
Make sure that this is not newer than package.json or anything in dist/,
so that none of the Makefile's rebuild rules trigger.

Closes #36
2018-07-19 09:11:07 +02:00
Martin Pitt
70c7242d9d Fix webpack result test in dist/
When building in production mode, there is no index.js, just an
index.min.js.gz. This previously caused unnecessary rebuilds, or even
RPM build failures in environments where npm was not available. Test for
index.html instead, which is reliable.

Also factor this out into a constant to make it easier to adjust in
forked projects.
2018-07-19 09:11:07 +02:00
Martin Pitt
9af00423f4 Ship final spec file instead of template in release tarballs
This is easier to handle downstream, as the spec file can be used as-is,
instead of having to get rebuilt.

Adjust the clean rule to only remove the .spec if the .spec.in exists,
so that it gets removed in the upstream git, but not in unpacked release
tarball trees.
2018-07-19 09:11:07 +02:00
Martin Pitt
12f82a8b31 Makefile: Drop unused directory from clean rule 2018-07-19 09:11:07 +02:00
Lars Karlitski
7fa53fa3f5 Run npm install when package.json changed
Closes #34
2018-07-16 18:58:38 +02:00
Martin Pitt
3109cad8ca Fix make dist with parallel make
Building the *.po files requires the `po2json` module, so add a
dependency to it.

Put the example node module into a variable to avoid repeating it. Also
test for `po2json` instead of `react-lite`, as the latter is more likely
to get replaced by actual projects in favor of the full React.

Closes #33
2018-07-16 17:56:34 +02:00
Martin Pitt
32e278b94f
Bump Cockpit test API to 172 (#32)
No API changes.
2018-07-12 08:01:41 +02:00
Martin Pitt
42579dcdc3 Run tests with Python 3
Bump Cockpit test API to 171 for this, which made the test API
bilingual.

Closes #31
2018-07-02 17:37:20 +02:00
Martin Pitt
78c613e2fa Bump Cockpit test API to 170
No API changes.

Closes #30
2018-06-27 10:49:28 +02:00
Martin Pitt
f26741e269 Add git tag derived version to tarball and spec
Stop hardcoding the version in the spec file, and put the version into
dist tarballs.

Closes #27
2018-06-22 20:07:29 +02:00
Martin Pitt
47e02ef136 Add i18n for HTML and manifest 2018-06-19 18:09:57 +02:00
Martin Pitt
7ce7b2b40b Add i18n support
Make the "Running on.." string translatable and copy the extraction and
conversion of JSX and PO files from Cockpit.
2018-06-19 14:40:45 +02:00
Martin Pitt
21950771af Makefile: Drop hardcoded "starter-kit" references
We already parse the project name from the manifest.
2018-06-19 14:25:26 +02:00
Martin Pitt
1edb6a070b Remove some instances of "starter kit"
Rename some files and change some identifiers to be neutral to the
application name. This makes it simpler to change everything to a proper
name when cloning this project.

Document in the README how to find the remaining places to change.

Closes #20
2018-05-04 19:19:29 +02:00
Martin Pitt
26c7b80a19 Bump Cockpit test API to 167
No API changes.

Closes #21
2018-05-04 19:18:04 +02:00
Martin Pitt
b614b72939 build: Add a make vm convenience target
With this one does not need to type the full path to the VM. This is
useful to demonstrate how to use other test frameworks than cockpit's
test API.

Closes #19
2018-03-28 13:00:38 +02:00
Martin Pitt
099ac621b2 test: Use test/common Cockpit API from latest stable tag
Cockpit's testlib.py has no stable API guarantee, so check it out from a
stable tag instead of master. This should occasionally be bumped to stay
current.

Note that the same does not apply to bots/: Stable tags are useless
there as the old images get cleaned up. Also, testvm.py API needs to be
stable for Cockpit's own purposes already.

This needs to drop the slight git checkout optimization, but this also
makes the code more symmetric and easier to understand.

Closes #18
2018-03-10 14:54:40 +01:00
Martin Pitt
8e9cc58eef build: On-demand rebuilding and add "devel-install" target
Don't always rebuild on "make" (in the phony "all" target), but
introduce a real file target dist/index.js and its requisites. This gets
rid of the "install-only" target, which is very non-standard and would
not on an unbuilt tree anyway.

Also add a "devel-install" target that does the usual symlinking of the
built source tree into ~/.local/share/cockpit.

Closes #17
2018-03-09 12:18:57 +01:00