Skip to content

Commit

Permalink
Merge branch 'cad/test-suite' of github.com:replit/upm into cad/yarn-…
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
cdmistman committed Oct 12, 2023
2 parents 22f1a83 + a842f33 commit 9a1e083
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 1,926 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/cmd/upm/upm
/dist/
statik/
/packaging/aur/*.tar.gz
/packaging/aur/*.tar.xz
/packaging/aur/pkg/
Expand Down
20 changes: 20 additions & 0 deletions .semaphore/install_nix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env sh

set -e
set -o xtrace

install_script_cache_key="install-nix-2.16.1"
install_script="/tmp/$install_script_cache_key"

# Install Nix. Install the base version if the currently installed version is
# not what we expect.
if [ \
! -f ~/.nix-profile/etc/profile.d/nix.sh -o \
"$(~/.nix-profile/bin/nix --version)" != "nix (Nix) 2.16.1" \
]; then
curl -L https://releases.nixos.org/nix/nix-2.16.1/install | sh
fi

source ~/.nix-profile/etc/profile.d/nix.sh

set +e
44 changes: 13 additions & 31 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,46 @@ version: v1.0
name: UPM
agent:
machine:
type: e1-standard-2

containers:
- name: main
image: gcr.io/marine-cycle-160323/nix@sha256:98a129684f9a4a15f1148c51f9769a9208dc4f34b823396100c5f67610b7fe1f

image_pull_secrets:
- name: upm-gcr-pull-secrets
type: s1-goval

global_job_config:
prologue:
commands:
- checkout
- git switch --detach
- export PATH="/tmp:$PATH"
- source ./.semaphore/install_nix.sh

blocks:
- name: setup
dependencies: []
task:
jobs:
- name: cache golint-ci
commands:
- >-
cache has_key golangci-lint || (
mkdir -p bin &&
curl
-sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh
| sh -s -- -b /tmp v1.52.2
&& cache store golangci-lint /tmp/golangci-lint
)
- name: build
dependencies: [ setup ]
dependencies: [ ]
task:
jobs:
- name: nix
commands:
# - cache restore nix-store
- nix build
- ./result/bin/upm --version
- cache store nix-store /nix

- name: test
dependencies: [ build, setup ]
dependencies: [ build ]
task:
jobs:
- name: test-suite
commands:
- nix develop -c make generated
- nix develop -c nix shell -c go test ./test-suite
- nix develop -c nix shell -c make ci-test-suite
epilogue:
commands:
- test-results publish junit.xml

- name: lint
dependencies: [ setup ]
dependencies: [ ]
task:
jobs:
- name: golang lint
commands:
- make generated
- cache restore golangci-lint
- golangci-lint run
- >-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh
| sh -s -- -b /tmp v1.52.2
- /tmp/golangci-lint run
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,8 @@ help: ## Show this message
.PHONY: test
test:
go test ./... -v

.PHONY: ci-test-suite
ci-test-suite:
go get gotest.tools/gotestsum
go run gotest.tools/gotestsum --junitfile ./junit.xml ./test-suite
5 changes: 0 additions & 5 deletions test-suite/templates/guess/js/basic

This file was deleted.

5 changes: 0 additions & 5 deletions test-suite/templates/guess/js/basic.expect

This file was deleted.

5 changes: 0 additions & 5 deletions test-suite/templates/guess/js/dedup

This file was deleted.

1 change: 0 additions & 1 deletion test-suite/templates/guess/js/dedup.expect

This file was deleted.

4 changes: 0 additions & 4 deletions test-suite/templates/guess/js/nested

This file was deleted.

2 changes: 0 additions & 2 deletions test-suite/templates/guess/js/nested.expect

This file was deleted.

3 changes: 0 additions & 3 deletions test-suite/templates/guess/ts/typeImports

This file was deleted.

3 changes: 0 additions & 3 deletions test-suite/templates/guess/ts/typeImports.expect

This file was deleted.

19 changes: 0 additions & 19 deletions test-suite/templates/nodejs-yarn/many-deps/package.json

This file was deleted.

Loading

0 comments on commit 9a1e083

Please sign in to comment.