How to omit one stage when include a remote pipeline

Replace this template with your information

Our devops team provides a common pipeline, but we don’t need some stages or jobs in our project.
How to disable them easily.

Here is an example of what devops provides in remote pipeline file.

prepare code:
  stage: prepare
  - xxxxx

build code:
  stage: build
  - xxxxx

test code:
  stage: test
  - xxxxx

deploy code:
  stage: deploy
  - xxxxx

What we expected is to skip the test stage.

What we do is only include stages that we need in our gitlab-ci.yml.

- project: xxxx
  ref: release-1.0
  file: common.gitlab-ci.yml

- prepare
- build
- deploy

What we got is an error while we lint the pipeline.

test code job: chosen stage does not exist;

any thoughts?