forked from a-h/templ
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add tests for dependent projects (a-h#559)
- Loading branch information
Showing
11 changed files
with
603 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,6 @@ result | |
# Editors | ||
## nvim | ||
.null-ls* | ||
|
||
# Go workspace. | ||
go.work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.2.580 | ||
0.2.581 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
testdata | ||
log.txt | ||
dependents.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM golang:1.22 | ||
|
||
ARG TEMPL_VERSION | ||
RUN go install github.com/a-h/templ/cmd/templ@$TEMPL_VERSION | ||
|
||
WORKDIR /app | ||
|
||
COPY run.sh /run.sh | ||
|
||
ENV TEMPL_VERSION=$TEMPL_VERSION | ||
ENTRYPOINT ["/bin/bash", "-c", "/run.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Dependents tests | ||
|
||
This project tests projects that use templ before deploying major changes to it. | ||
|
||
## Tasks | ||
|
||
### update-dependents | ||
|
||
Get a list of all public projects in Github that use templ. | ||
|
||
```bash | ||
nix run a-h/github-download-dependents-info -- a-h/templ --csv dependents.csv | ||
``` | ||
|
||
### clone-repos | ||
|
||
Clone them all. | ||
|
||
```bash | ||
go run main.go -access-token=`pass github.com/read-public-repos` | ||
``` | ||
|
||
### build-containers | ||
|
||
Build `templ-dependent:previous` and `templ-dependent:current` Docker containers that contain the expected versions of the templ CLI. | ||
|
||
```bash | ||
docker build \ | ||
--build-arg TEMPL_VERSION=v0.2.543 \ | ||
-t templ-dependent:previous \ | ||
. | ||
docker build \ | ||
--build-arg TEMPL_VERSION=ee2ba0e937dae19cf3bd1ee532ff3dcda5a8aae4 \ | ||
-t templ-dependent:current \ | ||
. | ||
``` | ||
|
||
### test | ||
|
||
```bash | ||
docker run -e TEMPL_PREFIX="random_number" -v `pwd`/testdata/yokaracho/calculator-calories:/app templ-dependent:previous | ||
docker run -e TEMPL_PREFIX="random_number" -v `pwd`/testdata/yokaracho/calculator-calories:/app templ-dependent:current | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
module github.com/a-h/templ/testdependents | ||
|
||
go 1.21.5 | ||
|
||
require ( | ||
github.com/docker/docker v25.0.3+incompatible | ||
github.com/go-git/go-git/v5 v5.11.0 | ||
github.com/google/uuid v1.6.0 | ||
) | ||
|
||
require ( | ||
dario.cat/mergo v1.0.0 // indirect | ||
github.com/Microsoft/go-winio v0.6.1 // indirect | ||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect | ||
github.com/cloudflare/circl v1.3.3 // indirect | ||
github.com/containerd/log v0.1.0 // indirect | ||
github.com/cyphar/filepath-securejoin v0.2.4 // indirect | ||
github.com/distribution/reference v0.5.0 // indirect | ||
github.com/docker/go-connections v0.5.0 // indirect | ||
github.com/docker/go-units v0.5.0 // indirect | ||
github.com/emirpasic/gods v1.18.1 // indirect | ||
github.com/felixge/httpsnoop v1.0.4 // indirect | ||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect | ||
github.com/go-git/go-billy/v5 v5.5.0 // indirect | ||
github.com/go-logr/logr v1.4.1 // indirect | ||
github.com/go-logr/stdr v1.2.2 // indirect | ||
github.com/gogo/protobuf v1.3.2 // indirect | ||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect | ||
github.com/kevinburke/ssh_config v1.2.0 // indirect | ||
github.com/moby/term v0.5.0 // indirect | ||
github.com/morikuni/aec v1.0.0 // indirect | ||
github.com/opencontainers/go-digest v1.0.0 // indirect | ||
github.com/opencontainers/image-spec v1.1.0 // indirect | ||
github.com/pjbgf/sha1cd v0.3.0 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/sergi/go-diff v1.1.0 // indirect | ||
github.com/skeema/knownhosts v1.2.1 // indirect | ||
github.com/xanzy/ssh-agent v0.3.3 // indirect | ||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect | ||
go.opentelemetry.io/otel v1.24.0 // indirect | ||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect | ||
go.opentelemetry.io/otel/metric v1.24.0 // indirect | ||
go.opentelemetry.io/otel/sdk v1.24.0 // indirect | ||
go.opentelemetry.io/otel/trace v1.24.0 // indirect | ||
golang.org/x/crypto v0.16.0 // indirect | ||
golang.org/x/mod v0.12.0 // indirect | ||
golang.org/x/net v0.19.0 // indirect | ||
golang.org/x/sync v0.5.0 // indirect | ||
golang.org/x/sys v0.17.0 // indirect | ||
golang.org/x/time v0.5.0 // indirect | ||
golang.org/x/tools v0.13.0 // indirect | ||
gopkg.in/warnings.v0 v0.1.2 // indirect | ||
gotest.tools/v3 v3.5.1 // indirect | ||
) |
Oops, something went wrong.