mirror of
https://github.com/siderolabs/talos.git
synced 2025-09-19 12:51:11 +02:00
chore: set version in unit-tests
Refs #4576. Signed-off-by: Alexey Palazhchenko <alexey.palazhchenko@talos-systems.com>
This commit is contained in:
parent
20d39c0b48
commit
5ac64b2d97
10
Dockerfile
10
Dockerfile
@ -570,7 +570,10 @@ RUN unlink /etc/ssl
|
|||||||
COPY --from=rootfs / /
|
COPY --from=rootfs / /
|
||||||
ARG TESTPKGS
|
ARG TESTPKGS
|
||||||
ENV PLATFORM container
|
ENV PLATFORM container
|
||||||
RUN --security=insecure --mount=type=cache,id=testspace,target=/tmp --mount=type=cache,target=/.cache go test -v -covermode=atomic -coverprofile=coverage.txt -coverpkg=${TESTPKGS} -count 1 -p 4 ${TESTPKGS}
|
ARG GO_LDFLAGS
|
||||||
|
RUN --security=insecure --mount=type=cache,id=testspace,target=/tmp --mount=type=cache,target=/.cache go test -v \
|
||||||
|
-ldflags "${GO_LDFLAGS}" \
|
||||||
|
-covermode=atomic -coverprofile=coverage.txt -coverpkg=${TESTPKGS} -count 1 -p 4 ${TESTPKGS}
|
||||||
FROM scratch AS unit-tests
|
FROM scratch AS unit-tests
|
||||||
COPY --from=unit-tests-runner /src/coverage.txt /coverage.txt
|
COPY --from=unit-tests-runner /src/coverage.txt /coverage.txt
|
||||||
|
|
||||||
@ -582,7 +585,10 @@ COPY --from=rootfs / /
|
|||||||
ARG TESTPKGS
|
ARG TESTPKGS
|
||||||
ENV PLATFORM container
|
ENV PLATFORM container
|
||||||
ENV CGO_ENABLED 1
|
ENV CGO_ENABLED 1
|
||||||
RUN --security=insecure --mount=type=cache,id=testspace,target=/tmp --mount=type=cache,target=/.cache go test -v -race -count 1 -p 4 ${TESTPKGS}
|
ARG GO_LDFLAGS
|
||||||
|
RUN --security=insecure --mount=type=cache,id=testspace,target=/tmp --mount=type=cache,target=/.cache go test -v \
|
||||||
|
-ldflags "${GO_LDFLAGS}" \
|
||||||
|
-race -count 1 -p 4 ${TESTPKGS}
|
||||||
|
|
||||||
# The integration-test targets builds integration test binary.
|
# The integration-test targets builds integration test binary.
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import (
|
|||||||
"github.com/talos-systems/talos/pkg/machinery/resources/k8s"
|
"github.com/talos-systems/talos/pkg/machinery/resources/k8s"
|
||||||
"github.com/talos-systems/talos/pkg/machinery/resources/kubespan"
|
"github.com/talos-systems/talos/pkg/machinery/resources/kubespan"
|
||||||
"github.com/talos-systems/talos/pkg/machinery/resources/network"
|
"github.com/talos-systems/talos/pkg/machinery/resources/network"
|
||||||
|
"github.com/talos-systems/talos/pkg/version"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LocalAffiliateSuite struct {
|
type LocalAffiliateSuite struct {
|
||||||
@ -67,7 +68,7 @@ func (suite *LocalAffiliateSuite) TestGeneration() {
|
|||||||
suite.Assert().Equal("example1", spec.Hostname)
|
suite.Assert().Equal("example1", spec.Hostname)
|
||||||
suite.Assert().Equal("example1.com", spec.Nodename)
|
suite.Assert().Equal("example1.com", spec.Nodename)
|
||||||
suite.Assert().Equal(machine.TypeWorker, spec.MachineType)
|
suite.Assert().Equal(machine.TypeWorker, spec.MachineType)
|
||||||
suite.Assert().Equal(" ()", spec.OperatingSystem) // build tags are not set for unit-tests
|
suite.Assert().Equal("Talos ("+version.Tag+")", spec.OperatingSystem)
|
||||||
suite.Assert().Equal(cluster.KubeSpanAffiliateSpec{}, spec.KubeSpan)
|
suite.Assert().Equal(cluster.KubeSpanAffiliateSpec{}, spec.KubeSpan)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user